Home Forums WinForms controls Xceed Grid for WinForms How to clear data bindings

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

    Hi

    I am trying to switch between datasets with my grid but I cannot seem to clear the old databindings and load new so when I try to display a different dataset I get an error which references the old dataset. I have tried

    grid.clear() – This works but it clears everything not just the databindings.
    grid.databindings.clear() – This does not appear to do anything.
    grid.datarows.clear() – No luck here either.

    Any ideas on how to do this would be appreciated.

    Thanks

    Nick Steele

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

    User (Old forums)
    Member
    Post count: 23064

    I think you should be able to just set the <b>DataSource</b> and <b>DataMember</b> properties of the GridControl to their new values.
    To clear the databindings, set both properties to <i>null</i> (<i>Nothing</i> in VB.NET).

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

    User (Old forums)
    Member
    Post count: 23064

    Tommy is always rite.

    Following will be an example:

    grid.datasource = nothing

    Imported from legacy forums. Posted by PETE (had 3473 views)

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