Does GridView.DataSource binding change reset column visible/layout?

2 posts, 0 answers
  1. Rob Ainscough
    Rob Ainscough avatar
    262 posts
    Member since:
    Jan 2010

    Posted 12 May 2010 Link to this post

    I'm looking for an alternative grid that is NOT based on Microsofts VERY POOR implementation of DataGridView.  The problem I'm having with the Microsoft DataGridView is summarized nicely in this YouTube Video:

    Basically if I set column visible and column formatting options in the designer/IDE and then during application runtime my code sets DataSource = myDataTable and then change the DataSource to another DataTable, ALL my column visible state and formatting information is reset to "default" state ... NOT good.  (note: ONLY when the DataSource is changed, first time it works fine and keeps visible/formatting info).

    Per video, the only work around is to add a BUNCH of code to DataBinding_Complete event to set my columns back to the state I setup via designer/IDE.

    So my questions:

    1.  Is Telerik Grid based on the Microsoft's implementation?
    2.  Is this same behavior "by design" in the Telerik Grid?

    Thanks, Rob.
  2. Martin Vasilev
    Martin Vasilev avatar
    1061 posts

    Posted 18 May 2010 Link to this post

    Hello Rob Ainscough,

    Thank you writing.

    RadGridView is not based on the Microsoft DataGridView. It is built on Telerik Presentation Framework which provides WPF-like visual effects and a great number of options to customize RadControls. You can find more details in our documentation.

    As to your second question, RadGridView can generate columns based on the data source or can use a user defined (at design-time) columns' layout. If you follow the second scenario, the columns' layout will not be changed if you change the data source and the new data source has the same layout. In addition, you can use Save/LoadLayout methods to save the column settings.

    Do not hesitate to contact me again if you have any additional questions.

    Sincerely yours,
    Martin Vasilev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top