DataTable and DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello,

i have dataGrid and Created a DataTable which will be the dataGrid Source.

how can design my coulmns ( i want to set the width for example)?

and i can i set a dataSet for my DataTable?

thank you
 
Hello Gidi,

Assuming you mean the WinForms datagrid:
You can control the width of the data grid columns by populating the
DataGridTableStyle's Columns collection manually with the appropriate
DataGridColumnStyle-derived classes such as DataGridTextBoxColumn and
setting properties such as Width on the column styles.

The "Customizing the Windows Forms DataGrid" article by Dr. Clay Burch,
available in MSDN, has a lot of detail on this.
 
Thanks Dimitry,
that i know, the onlt problem is that i tried with no success to connect my DataGridTableStyle to my DataTable and because of that i can't use it.

what can i do?

Dmitriy Lapshin said:
Hello Gidi,

Assuming you mean the WinForms datagrid:
You can control the width of the data grid columns by populating the
DataGridTableStyle's Columns collection manually with the appropriate
DataGridColumnStyle-derived classes such as DataGridTextBoxColumn and
setting properties such as Width on the column styles.

The "Customizing the Windows Forms DataGrid" article by Dr. Clay Burch,
available in MSDN, has a lot of detail on this.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

Gidi said:
hello,

i have dataGrid and Created a DataTable which will be the dataGrid Source.

how can design my coulmns ( i want to set the width for example)?

and i can i set a dataSet for my DataTable?

thank you
 
Back
Top