Editing the raw value of cell (no formatting)

Is there any way to force the grid to display the raw, non-formatted value of a cell when a user starts editing it?

E.g. if a cell's value is 5000000 and after formatting it gets displayed as 5,000.00 then I would like to edit the original value instead of the formatted one.

Thanks,
J


1 Reply

RC Rajadurai C Syncfusion Team March 12, 2009 12:50 PM UTC

Hi John,

Thanks for your interest in Syncfusion products.

Please try handling the CurrentCellActivated and CurrentCellDeactivated events with the following code.

void gridControl1_CurrentCellDeactivated(object sender, GridCurrentCellDeactivatedEventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
this.gridControl1[cc.RowIndex, cc.ColIndex].Format = "##.00";
}

void gridControl1_CurrentCellActivated(object sender, EventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
this.gridControl1[cc.RowIndex, cc.ColIndex].Format = "##";
}


The required functionality can be achieved by this code.

Regards,
Rajadurai


Loader.
Up arrow icon