|
dataGrid.QueryUnboundColumnValue += DataGrid_QueryUnboundColumnValue;
private void DataGrid_QueryUnboundColumnValue(object sender, GridUnboundColumnEventsArgs e)
{
if (e.UnboundAction == UnboundActions.QueryData)
{
var Distance = Convert.ToInt16(e.Record.GetType().GetProperty("Distance").GetValue(e.Record));
var Distance2 = Convert.ToInt16(e.Record.GetType().GetProperty("Distance2").GetValue(e.Record));
var Total = Distance * Distance2;
e.Value = Total;
}
}
|
|
public int Distance
{
get { return distance; }
set
{
this.distance = value;
RaisePropertyChanged("Distance");
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged(string name)
{
if (PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
} |
Hi Claudio,
In our SfDataGrid we have perform all the grid
operation using Mapping name only. In UnboundColumn Expression or GridUnboundColumnEventArgs.Value
has been calculated based on the Model object. We request you to set newly
updated value to model object. We have prepared the sample based on this and
attached in the below location, please refer it.
Sample: GettingStarted_2e74ce05.zip
Regards,
Ashok