We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Calculated fields in Grid

Hi

I'm trying to validate a grid by using column values. For example, for Column X, all rows should add to 100%. And if the value in Column X changes, the value in Column Y needs to change accordingly. Whats the best implementation for this using the DataBoundGrid?

Thanks
Varuni

1 Reply

LS Lingaraj S Syncfusion Team August 14, 2009 01:51 PM UTC

Hi Varuni,

Thank you for your interest in Syncfusion product.

If you want to change the another column value based on the another column value then please try using CurrentCellAcceptedChanges event in GridDataBoundGrid to achive this functionality.

Refer the ode below:

this.gridDataBoundGrid1.CurrentCellAcceptedChanges += new CancelEventHandler(gridDataBoundGrid1_CurrentCellAcceptedChanges);
void gridDataBoundGrid1_CurrentCellAcceptedChanges(object sender, CancelEventArgs e)
{
int row=this.gridDataBoundGrid1.CurrentCell.RowIndex;
int col=this.gridDataBoundGrid1.CurrentCell.ColIndex;
if (col == 2)
{
this.gridDataBoundGrid1[row, 3].Text = this.gridDataBoundGrid1[row, col].Text + "Ch";
}
}


Please let me know if you have any queries.

Regrads,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon