I set the min height of a datagrid that way:
<DataGrid MinRowHeight="40">
After feeding the datagrid with datas, the text in each cell is top and left aligned. I could not find an easy way to center that text.
Any suggestions for doing that?
I set the min height of a datagrid that way:
<DataGrid MinRowHeight="40">
After feeding the datagrid with datas, the text in each cell is top and left aligned. I could not find an easy way to center that text.
Any suggestions for doing that?
use ElementStyle
Final solution:
Here is a slightly longer version of Arpit Shah's answer.
you can use styles. i add a sample for DataGridCheckBoxColumn, i hope it put you in the right direction.
Try setting the DataGrid's Vertical and HorizontalContentAlignment to Center
If that doesn't work, you can use the solution in this answer. It uses a style that aligns the DataGrid cell contents
The following code will center the contents of cells in DataGrid: