I have a data table. After creating this table, I use data grid view to show data by simply using the code:
mydataGridView.DataSource = myTable;
By this, dataGridView creates columns and rows according to data from myTable automatically.
However, when I do that, I can’t set the width of columns in dataGridView. What should i do to fix this?
I don’t use any code for setting size. My dataGridView auto generates the columns and i want to set the size of these auto generated columns.
Well… into the xaml of your DataGrid, you have the ColumnWidth parameter that does just that.