Home Forums WinForms controls Xceed Grid for WinForms How do I re-initialize grid?

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

    Hi

    I have a grid that displays different tables. The problem I have is that the column count in the tables is different so if I for instance display a table with 5 columns then try to display a table with 8 columns only 5 columns out of the eight are displayed. I tried using grid.clear this will display the right amount of columns but then I lose all the formatting (column headers etc). What is the correct method to re-initialize a grid to display different tables.

    Thanks

    Nick Steele

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

    User (Old forums)
    Member
    Post count: 23064

    A possible solution might be to use 1 grid control for each table, and just show 1 of the grid controls. When you want to display a different table, just make the current grid invisible, and make the new grid visible.

    Imported from legacy forums. Posted by Tommy (had 220 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi

    Just a followup for the group. After talking to technical support they told me that if you set the datasource and datamember seperately this creates an invisible column which is not cleared, this is what was screwing me up. The correct way to do it is to use the setdatabindings method this does not create the extra column and all colums are cleared using the grid.coulmns.clear method. I tried this and it works.

    Thanks

    Nick Steele

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

    User (Old forums)
    Member
    Post count: 23064

    Thanks for sharing the solution.

    Imported from legacy forums. Posted by Tommy (had 3999 views)

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