Dear Sir
I had a problem when i calculate the Column i.e (qty * rate) = GrossAmount
i wanted that user cannot edit the GrossAmount Column so i use `Cell Edit` Event . Event working properly but it cant show me value in Gross Amount Column when i put (qty and Rate) if i remove my event it show.
But i wanted to user cannot use this GrossAmount Column to Edit.
Which i Event use i describe you below : -
'''''' This Event i use for calculation
private void CellSaved(CellSaveArgs<LedgerAccounts> args)
{
args.Data.GrossAmount = args.Data.Qty * args.Data.Rate;
Grid.UpdateCell(Grid.SelectedRowIndex, "GrossAmount", args.Data.GrossAmount);
if(args.Data.DiscPer > 0)
{
args.Data.DiscAmount = (args.Data.GrossAmount * args.Data.DiscPer)/100;
}
args.Data.NetAmount = args.Data.GrossAmount - args.Data.DiscAmount;
Grid.UpdateCell(Grid.SelectedRowIndex, "NetAmount", args.Data.NetAmount);
}
''''' Now this Event I use for not Edit in Gross Amount Column
public void CellEditHandler(CellEditArgs<LedgerAccounts> args)
{
if (args.ColumnName == "GrossAmount")
{
args.Cancel = true;
// Grid.Refresh();
}
}