|
private void DataGrid_QueryUnboundColumnValue(object sender, Syncfusion.UI.Xaml.Grid.GridUnboundColumnEventsArgs
{
if (e.UnBoundAction == UnBoundActions.QueryData)
{
var value1 = Convert.ToInt32(e.Record.GetType().GetProperty("Value1").GetValue(e.Record));
var value2 = Convert.ToInt32(e.Record.GetType().GetProperty("Value2").GetValue(e.Record));
if (value1 != 0 && value2 != 0)
{
double value = ((value1 / value2) - 1) * 100;
e.Value = value.ToString() + "%";
}
else
e.Value = 0;
}
} |
|
private void DataGrid_CurrentCellValidated(object sender, CurrentCellValidatedEventArgs e)
{
this.dataGrid.GetUnBoundCellValue(this.dataGrid.Columns["Percentage"], e.RowData);
} |