Home Forums WPF controls Xceed DataGrid for WPF Bug or Feature? – Changing DataContext problem

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

    Hi, I’m using v1.1.

    I have :
    – a window with a datacontext set to a dataset.
    – A xceed grid with ItemsSource (Binded in xaml) set to a table of the DataSet used as datacontext
    – A button that (when clicked) changes the Window’s DataContext to another DataSet exactly like the one before (same schema, table names, etc.).

    Results:
    After pressing the button and the DataContext changes, the grid loses it’s grip on the datacontext and does not show any rows.

    Although the DataContext is a different instance it still has a datatable with the same name so the grid should be smart enough to remain “Connected” with the data.
    All controls in the .net framework present the “Connected” behaviour that I am describing.

    Thank you.

    Imported from legacy forums. Posted by Hugo (had 5504 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    I am having a similar problem. In my project I am using grids in TabItems. Every TabItem contains a grid and every TabItem has a different DataContext.
    Switching between the Tabs results to a crash of the DataGrids. The grid looses all the rows, changes to the underlying object won’t affect the grid … to make it short: it totally crashes.

    I have reported this issue already by Mail to Xceed. Hope a fix will come soon 🙂

    cheers
    Silas

    Imported from legacy forums. Posted by Ralf (had 224 views)

    User (Old forums)
    Member
    Post count: 23064

    im also facing similar problems. i also use the xceed grid on different tab items and
    in many circumstances my grid gets empty (it doesnt display any data, except the gridlines) after making changes to the datacontext
    ive also reported this to xceed staff via mail and repro-app, and i also hope a fix will come out soon for this 🙂

    Imported from legacy forums. Posted by Benno (had 296 views)

    User (Old forums)
    Member
    Post count: 23064

    In my case it was not a problem of the grid but a WPF limitation. Thanks to vanguard support from Xceed it works now.

    Thank you very much guys, you rock!

    cheers
    Silas

    Imported from legacy forums. Posted by Ralf (had 494 views)

    User (Old forums)
    Member
    Post count: 23064

    Could you elaborate a bit more on that wpf limitation?

    I am sure it’s not a wpf limitation in my case but I am curious non the less.

    Imported from legacy forums. Posted by Hugo (had 368 views)

    User (Old forums)
    Member
    Post count: 23064

    I am not quite sure if i understand correctly what you would like to do…

    To what kind of element did you assign the DataContext to?
    I guess you could also try to do those things with DataTemplates.

    Silas

    Imported from legacy forums. Posted by Ralf (had 428 views)

    User (Old forums)
    Member
    Post count: 23064

    The datacontext is set on a Parent of the DataGrid in this case it is a Window element but it could be a grid , etc. it does not matter.

    What is important is that when the datacontext is changed manually the grid does not automatically bind it self again to the new DataContext’s data.
    It should remain binded to the the DataContexttext’s data because it is a dataset with the same schema as before the change occured.

    Imported from legacy forums. Posted by Hugo (had 434 views)

    User (Old forums)
    Member
    Post count: 23064

    Same problem here.

    Any fix or workarround for this issue?

    Imported from legacy forums. Posted by js (had 263 views)

    User (Old forums)
    Member
    Post count: 23064

    The next service release, which should be published next week, includes a fix for a problem with the data grid not refreshing properly (or at all) when the data source changes. I can’t say for sure if this fix will apply to every specific problem described in this thread, but it will be definitely be a good thing for everyone in this thread to test your apps with that service release.

    If any problems remain, we will address them as soon as possible.

    Thanks for your patience!

    Imported from legacy forums. Posted by Pascal (had 6607 views)

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