Home Forums WPF controls Xceed DataGrid for WPF Update Grouping On Data Change

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

    I have a Status enum in the class I’m displaying in a DataGridCollectionView, and they essentially represent states of a statemachine, but with different paths. Waiting can go to Cancelled, Cancelled can go back to Waiting, Failed can go to Waiting, etc. From the users perspective its basically a toggle, but I didn’t want a checkbox. So, I implemented a Button:

    Content=”{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=xcdg:DataCell}, Path=ParentRow.DataContext.ToggleText}”

    with this as the event handler

    private void toggleAnalysisStatus_Click(object sender, RoutedEventArgs e)
    if (this.tlist.CurrentItem == null)

    DataRow row = this.tlist.GetContainerFromItem(this.tlist.CurrentItem) as DataRow;

    if (row != null)
    CalGroupItem item = row.DataContext as CalGroupItem;
    if (item != null)
    //(tlist.ItemsSource as DataGridCollectionView).Refresh();

    The problem is that if I group by AnalysisStatus, then toggle an item’s AnalysisStatus, the edited row doesn’t re-position to its new group.

    If I uncomment the Refresh line above, it does update the grouping, but its not speedy and looses the collapsed state of other groups. Is there another function I can call to get it updated more specifically?


    Imported from legacy forums. Posted by Thomas (had 2047 views)

    Xceed Support
    Post count: 5658

    I will assume that you are not using version 2.0 since the state of the groups is preserved as of that version. That said, other than calling Refresh, which also has the side effect of losing the expansion state of groups (as you experienced), there is no other method to update the grouping manually.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 2913 views)

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