Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
985
xamdatagrid datasource binding
posted

Hello Infragistics team,

I am trying to bind a xamdatagrid to a list of  classes implementing INotifyPropertyChagned. Below is the xaml code for the grid:

<igWPF:XamDataGrid Grid.Row="1" Height="253" HorizontalAlignment="Left" Margin="10,0,0,0" Name="xamDataGrid1" VerticalAlignment="Top" Theme="IGTheme" BindToSampleData="False" IsNestedDataDisplayEnabled="False" DataSource="{Binding Items, Mode=TwoWay}" BorderThickness="2" BorderBrush="#FF1A008D" IsGroupByAreaExpanded="False" GroupByAreaLocation="None" Width="901" ActiveDataItem="{Binding SelectedItem, Mode=TwoWay}">

Below is the code in the VM:

public List<ItemWrapper> Items { get; set; }

On loading the View I load the list of items in the public constructor, and it gets displayed in the grid. Code in VM (implements INotifyPropertyChanged):

this.Items = bus.GetItems();

Then in I try deleting an item in the collection, and loading the Items again when a user clicks a button. The following is the code in the VM

this.Items = bus.GetItems();

RaisePropertyChanged("Items");

This time the data in the xamdatagird doesnt get updated. Why is the data in the UI grid in the second case not getting updated? PS: I have debugged the code. and I am confident that when I execute the function bus.GetItems() in the second case, it is returning less number of items (after deletion). 

Thank you.

  • 138253
    Offline posted

    Hello Sherif,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

  • 138253
    Offline posted

    Hello Sherif,

     

    Thank you for your post. I have been looking into, but since I cannot be completely sure how your Data is organized I am not able to conclude what can cause this behavior, so could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.

     

    Looking forward for your reply.