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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ReadOnly Currency Cell

Thread ID:

Created:

Updated:

Platform:

Replies:

98377 Feb 23,2011 07:21 PM UTC Mar 3,2011 01:47 PM UTC WinForms 2
loading
Tags: GridControl
Qingde Shi
Asked On February 23, 2011 07:21 PM UTC

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;

Thanks,

Q


Qingde Shi
Replied On February 23, 2011 07:33 PM UTC

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?

Thanks,

Q


Mahendran [Syncfusion]
Replied On March 3, 2011 01:47 PM UTC

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.

Regards,
R.Mahendran


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.

Warning Icon 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.Close Icon

;