Home Forums WinForms controls Xceed Grid for WinForms How do I add column to grid

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14958 |

    Hi

    I have a grid populated with a dataset. I wish to add another column to the grid for data entry that is not based on the dataset.

    Is this possible?

    Thanks

    Nick Steele

    Imported from legacy forums. Posted by Nick (had 2864 views)

    User (Old forums)
    Member
    Post count: 23064

    You can either do it the designer, by using the context menu, and select “Add column (unbound)”, or do it in code using the Column class.

    e.g.:

    Column column1 = new Column( “New Column”, typeof( string ) );
    gridControl1.Columns.Add( column1 );

    Imported from legacy forums. Posted by André (had 310 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi

    Thanks for the answer. Is there a way to specify at what position in the grid the column appears, for example I would like this column to appear after a col that is in the middle of the grid right now it appears at the end.

    Thanks

    Nick Steele

    Imported from legacy forums. Posted by Nick (had 402 views)

    User (Old forums)
    Member
    Post count: 23064

    Set the VisibleIndex property of the column to the index where you would like it to appear.

    If you add the column in the designer, you can select the column where you want it to appear, right click, and choose “Insert column (unbound)”, and it will insert a new column to the right of the selected column.

    Imported from legacy forums. Posted by André (had 3917 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.