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.

ReadOnly Currency Cell

Thread ID:





98377 Feb 23,2011 02:21 PM Mar 3,2011 08:47 AM Windows Forms 2
Tags: GridControl
Qingde Shi
Asked On February 23, 2011 02:21 PM

Hi ,

I am using gridcontrol in virtual mode. How to make a cell using CurrencyEidt but is read only, not editable?

Try the following, but it does not work.

e.Style.CellType = GridCellTypeName.Currency;
e.Style.ReadOnly = true;



Qingde Shi
Replied On February 23, 2011 02:33 PM

To make it clearer, when clicking the currency cell, it apprears it changed to editting mode (format and symbol removed), but can not enter value, so it is readonly. but the question is how to make it appears static, clicking the cell does not change its currency format?



Mahendran [Syncfusion]
Replied On March 3, 2011 08:47 AM

Hi Qingde,

Thanks for your interest in Syncfusion products.

You can set the Currency symbol when the cell type as Currency and ReadOnly.You need to handle the CurrentCellStartEditing event handler with respective code. The following code explains the same.

this.gridControl1.CurrentCellStartEditing += new CancelEventHandler(gridControl1_CurrentCellStartEditing);
void gridControl1_CurrentCellStartEditing(object sender, CancelEventArgs e)
GridCurrentCell cc = this.gridControl1.CurrentCell;
if (cc.Renderer is GridCurrencyTextBoxCellRenderer && cc.Renderer.StyleInfo.ReadOnly)
e.Cancel = true;

Please let us know if you ave any concerns.



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.