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
345
XamDataGrid not getting updated
posted

I am using XAMDataGrid the source of which is bind to an observablecollection.

I have called the INotifyProperty changed event for "Value" property of class DataBlock in constructor as below:

this.CellData.PropertyChanged += (s, e) =>
{
if (e.PropertyName == nameof(Value))
this.OnPropertyChanged(nameof(Value));
};

I can see the field "value" is getting updated while debugging but I cannot see the updated value on XamDataGrid ,

the value on xamdatagrid is not getting changed while performing some operation. Only when I scroll up pr down I can sse the updated values.

Can you please suggest what is the issue in my code.

Below is my code:

The code behind code is :

public ObservableCollection<CalculationData> DataBlock
{
get
{
if (_DataBlock!= null)
return _DataBlock;

_AggregateDataBlocks = res;
return _AggregateDataBlocks;
}

private ObservableCollection<CalculationData> _DataBlock;}

public class CalculationData: INotifyPropertyChange
{

    public string name { get; private set; }

   

public object Value {
get {

        res = "abc";

        return res;
     }
   }

}

public event PropertyChangedEventHandler PropertyChanged;

private void OnPropertyChanged(string propName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propName));
}
}

and my XML code

<idp:XamDataGrid Name="grdElementCollection" DataSource="{Binding DataBlock}"
RecordExpanded="grdElementCollection_RecordExpanded"
Height="Auto" Width="Auto"
VerticalAlignment="Top" MinHeight="30"
GroupByAreaLocation="None"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
AllowDrop="True"

ScrollingMode="Immediate" 

IsSynchronizedWithCurrentItem="True"
BorderThickness="1"

>

<idp:XamDataGrid.FieldLayouts >
<idp:FieldLayout>

<idp:FieldLayout.Fields>

<idp:Field Name="Name" AllowEdit="False" Width="180" >
</idp:Field>
<idp:Field Name="Value" AllowEdit="False" Width="70" >
</idp:Field>

</idp:FieldLayout.Fields>
</idp:FieldLayout>
</idp:XamDataGrid.FieldLayouts>
</idp:XamDataGrid>

  • 2490
    Offline posted

    Hello Richa,

    Thank you for the code you have sent.

    If it possible send the whole CellData code. Also, how do you change the data?
    In this scenario the best option would be if you can prepare a small sample application, which illustrates the issue you are experiencing. This application will help to test and debug the described behavior.

    Having this information will help me to further investigate this for you.