How can I change width of columns in Datagrid?
( System.Windows.Forms.DataGrid)
Printable View
How can I change width of columns in Datagrid?
( System.Windows.Forms.DataGrid)
on datagrid properties
click TableStyles or access it via in code.
its a collection.
select the DataGridTableStyle object and then
goto
DataGridColumnStyle which is again collection
via this you could change the width. and
it will reflect the output.
prefferedrowwidth is to change the row width.
this.objTableStylegrdEmpmasterEmpmaster.PreferredColumnWidth = 200;
this.objTableStylegrdEmpmasterEmpmaster.PreferredRowHeight = 60;
hope it helps
-Paresh
Thanks, Paresh.
I had trouble with that because I forgot set "Mapping Name" :(
It's strange but I can't set Width to 100 pt per column!?
Bigger or smaller values works. :)
Gnacz.