Home Forums WinForms controls Xceed Grid for WinForms Inserting Columns Dynamically

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

    Hello,

    My application adds columns dynamically, and I want to insert them into the grid (Xceed Grid 3.0) alphabetically. I’ve tried this:

    int insertHere = SortedFooterIndex(ObjectName);
    this.Columns.Insert(insertHere, new Column(ObjectGuid));

    …where “this” is my Xceed Grid, and SortedFooterIndex() is a custom method that steps through the column heading values to determine the index where the new column should go to maintain column heading alphabetizing.

    No exception is thrown, but the new column always appears to the right (appended) to the grid even though the column index value is less than the number of rows.

    It seems that the column insertion works, but it is always displayed as if I called

    this.Columns.Add(new Column(ColumnNameGuid));

    Pointers to resources would be appreciated. Thanks!

    Imported from legacy forums. Posted by camera (had 1858 views)

    User (Old forums)
    Member
    Post count: 23064

    Got it.

    int insertHere = SortedFooterIndex(ObjectName);
    int actualIndex = this.Columns.Add(new Column(ObjectGuid));

    this.Columns[actualIndex].VisibleIndex = insertHere;

    Imported from legacy forums. Posted by camera (had 2913 views)

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