Hi
You can try using GridColumnStyles property to add or remove a column
Steps to do that
1. Create a reference for DataGridTableStyl
Dim tableStyle As New DataGridTableStyle(
2. Create a DataGridTextBoxColumn or DataGridBoolColumn, which is going to represent the column (choose the first one if we are going to display a textbox, or if check box is to be displayed use the second one
Dim Colu As New DataGridTextBoxColum
Colu.MappingName = "<filed name in the data table>
Colu.HeaderText = "Text to be displed in the header
Colu.Width = 3
tableStyle.GridColumnStyles.Add(colu
3. Link this add all the column, the columns will get populated in the same order added to the tablestyle
4. Clear the TablesStyles property of the datagri
datagrid1.TableStyles.Clear(
5. Add the tablestyle object tot he Tablestyles of the datagrid
datagrid1.TableStyles.Add(tableStyle
After this you will be getting all ur required fields. A new column can also be added to the datagrid by adding a column to the datatable and defining the datatablestyle
I hope i made it very clear. Feel free to contact me
Sadha Sivam
Microsoft Community Star
Malleable Minds Software Pvt Ltd.
India
(e-mail address removed)