Home Forums WPF controls Xceed DataGrid for WPF Wrong order of items when grid is grouped

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

    Hi there,

    I have the following problem:

    When the grid is grouped by a column, the underlaying order of the items is not the same as the displayed one.

    Example:

    XAML:

    <xcdg:DataGridControl ItemsSource=”{Binding}”/>
    <TextBox Text=”{Binding Path=column1}”/>

    Codebehind:

    DataSet DS = new DataSet();
    FillDataSet(DS);
    this.DataContext = DS.Tables[0].DefaultView;

    The binding works correct if the is ungrouped, if I select a row the correct value of the first column is shown in the textbox.
    But if I group by column1, I get wrong values in the textbox (SelectedItem != TextBox Binding Item)

    The strange thing is that if (still grouped by col.1) I sort column1, the values in the textbox are again shown correct.

    Thank you for answers
    Regards, b.greber

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

    User (Old forums)
    Member
    Post count: 23064

    up :/

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

    Xceed Support
    Member
    Post count: 5658

    Just to let you know, we have noted this issue and will take a look into it.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 300 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok .. thanks Marcus
    Is there a time-frame for the release of a update in which this issue will be fixed?

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

    User (Old forums)
    Member
    Post count: 23064

    We’ve been able to reproduce the problem. We’re investigating the cause and potential fixes, we’ll follow-up here when we have any news regarding this problem!

    Regards,

    Pascal Bourque

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

    Xceed Support
    Member
    Post count: 5658

    Hi,

    Just wanted to drop in you concerning this issue…

    Based on my tests, the problem is caused by a clash of the currency management between the DataGridControl.Items ( ItemCollection ) CurrentItem/CurrentPosition properties and the DataView`s architecture (namely, a DataRowView always remains at a fixed “position” while its underlying DataRow changes)…

    The same problem can be observed in a ListBox or Selector if they are grouped and the IsSynchronizedWithCurrentItem property is set to True.

    Since the DataGridControl does not implement an equivalent to IsSynchronisedWithCurrentItem at the moment, there is currently no way to “prevent” this behavior…

    The workaround I can propose is that instead of relying on the current item of the DataView (e.g. <TextBox Text=”{Binding Path=column1}”/> ), you could rely on the CurrentItem of the DataGridControl as in the exemple below:

    <xcdg:DataGridControl x:Name=”myDataGrid” ItemsSource=”{Binding}”/>
    <TextBox Text=”{Binding ElementName=myDataGrid, Path=CurrentItem.column1}”/>

    While this issue will not be resolved in the soon to be released version 1.2, we are going to try addressing this issue in a further service release.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 4722 views)

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