Wednesday, August 02, 2006

Columns hide in Winforms Datagrid

This code is to hide the columns in the DataGrid in WinForms Application.

DataGridTableStyle ColHidStyle = new DataGridTableStyle();
ColHidStyle.MappingName = "HideTest";
dataGrid1.TableStyles.Add(ColHidStyle);
ColHidStyle.GridColumnStyles["Modifier"].Width = 0;

or other way is

objDs.Tables["myTableName"].Columns["myColumnName"].ColumnMapping = MappingType.Hidden;

1 comment:

Sadhik Aboobaker said...

It is about removing record from dataset
when i removed a row from the dataset(datset.tablename.rows.remove(row))
after that when i saved a new record it saved on the removed rows position like when i removed the 2nd row and when i am saving the 5th row it is saving on the 2nd position.I already used the dataset.table.clone command

ASP.NET MVC - Sport Facility Booking system

  The project relies on some external service providers. Thus accessing them via their API requires authentication. An API Key need to be su...