DataGrid Columns Hide?

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

Guest

I have created my dataset with from my Tables, I have to have the KeyID column in the dataset to use the UPDATE dataset. But I don't want to show the KeyID column in the DataGrid. Is this possilbe? Or if I can not do this, can I make just that column read only. If I have to show the column, I don't want the use to edit it.
 
Hi Bill,

This is possible. Create a DataGridTableStyle instance and configure its
Columns collection with an appropriate number of DataGridColumnStyle
instances. Take note of that this should be done BEFORE the grid is bound to
the data.

You will find more information in the "DataGridTableStyle Class" topic in
the MSDN Library.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Bill S said:
I have created my dataset with from my Tables, I have to have the KeyID
column in the dataset to use the UPDATE dataset. But I don't want to show
the KeyID column in the DataGrid. Is this possilbe? Or if I can not do
this, can I make just that column read only. If I have to show the column,
I don't want the use to edit it.
 
Back
Top