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;

Comments

Sadhik 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

Popular posts from this blog

ASP.NET website "Cannot read configuration file due to insufficient permissions" in IIS 7 and Windows Server 2008

Error occurred in deployment step 'Install app for SharePoint': The System Account cannot perform this action.

None of the selected features can be installed or upgraded. Setup cannot proceed since no