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
160
XamDataGrid UI Refresh Issue(PropertyChanged is Happening)
posted

Hi All,

 Iam using the XamDatgrid(V10.3) for displaying some columns on the screen. I am facing some issues with the UI getting refreshed even though the bound property is changing. I am using the MVVM pattern. Heres what I'll do.

1. I will make a call asynchronous to a web service to fetch server data and I do one of the following

      a. If the data comes back, I will convert it to a DataTable and bind it to the grid

       b. If the data does not come back, I will bind a dummy datatable to the grid.

The behavior of the grid is really inconsistent. The first time it seems to load the acual/dummy data properly and when i try to refresh with new data its not working. Sometimes even the first time the data is not loading properly

1. I am using the NotifyPropertyChanged Interface in my base class and calling it from the derived viewmodels. Will verify that its working in all my viewmodels.

2. The PropertyChanged Event is NOT NULL AND FIRED PROPERLY.

Following is the xaml for the Grid. I have tried the RecordLoadingMode as PreLoad,OnDemand and various options I have tried.

<igDP:XamDataGrid Grid.Row="0" x:Name="_equityRealizedRiskReturnGrid" GroupByAreaLocation="None" DataSource="{Binding Path=EquityRiskReturnRealized,UpdateSourceTrigger=PropertyChanged}" RecordContainerGenerationMode="Virtualize" RecordLoadMode ="LoadOnDemand">

The FieldLayouts are defined beforehand and I have tried the different options for RecordContainerGenerationMode,RecordLoadMode etc. Nothing seems to work.

Can anyone help me out with this issue?Thanks a million in advance

Ram

  • 27093
    posted

    Hello Ram,

     

    I have been looking into your description and the XamDataGrid is meant to refresh on DataSourceChanged without the need of the properties you have set. Also the default UpdateSourceTrigger value of the WPF Binding class for most properties is PropertyChanged, so you needn’t set it. I have created a sample project for you (WpfApplication11.zip), that uses a model view and has two methods for switching the bound property between two DataTables and everything works as you expect it to.

     

    Please look through the sample and let me know if you require any further clarification on the matter.

    WpfApplication11.zip