Home Forums WinForms controls Xceed Grid for WinForms Selecting which columns to add to Datagrid from dataset Reply To: Selecting which columns to add to Datagrid from dataset

User (Old forums)
Member
Post count: 23064

I assume you are doing something like:

myGrid.SetDataBinding( dataSet1, “Money” );

This will bind the entire dataset to the grid. You can then do:

foreach( Xceed.Grid.Column GrdCol In myGrid)
{
GrdCol.Visible = False;
}

Then:

myGrid.Columns[ “fecha”].Visible = True;
myGrid.Columns[ “fecha”].Width=120;
myGrid.Columns[ “rotation”].Visible = True;
myGrid.Columns[ “rotation”].Width=70;

You can also set the VisibleIndex to control the positions of the columns.

Imported from legacy forums. Posted by Kareem (had 240 views)