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.
Unfortunately, activation email could not send to your email. Please try again.

Editing the raw value of cell (no formatting)

Thread ID:

Created:

Updated:

Platform:

Replies:

80076 Mar 11,2009 10:03 AM Mar 12,2009 08:50 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 11, 2009 10:03 AM

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


Rajadurai C [Syncfusion]
Replied On March 12, 2009 08:50 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;