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.

Preventing edit on grid cell

Thread ID:

Created:

Updated:

Platform:

Replies:

66879 Aug 3,2007 03:43 PM Aug 6,2007 07:00 PM Windows Forms 3
loading
Tags: GridControl
Omar
Asked On August 3, 2007 03:43 PM

Hi,

I would like to set certain cells in the grid to be read-only.

I have tried using the GridStyleInfo.ReadOnly property, but while this prevents editing, it still allows the cursor to enter the cell upon double-click. Thus, I am instead canceling the CurrentCellStartEdit event on certain cells to prevent this.

However, I would like to know if there is any alternative property I can use to make a cell read-only (and cursor does not enter cell upon double-click)?

Thanks in advance!

Omar

haneefm [Syncfusion]
Replied On August 3, 2007 04:11 PM

Hi Omar,

Try setting the CellType property of the gridcell to "Static" and let me know if this helps.

e.Style.CellType = "Static";

Best regards,
Haneef

Omar
Replied On August 3, 2007 05:07 PM

Hi,

While setting the CellType to Static did work, I can't really do this because I have a formula in my cell and the celltype is already set to FormulaCell.

I assume the only way around this problem then is to create a custom celltype?

Thanks.

Omar

>Hi Omar,

Try setting the CellType property of the gridcell to "Static" and let me know if this helps.

e.Style.CellType = "Static";

Best regards,
Haneef

haneefm [Syncfusion]
Replied On August 6, 2007 07:00 PM

Hi Omar,

You can try setting the style.Enabled property to false in a Grid FormulaCell or you can handle the CurrentCellStartEditing event and set e.Cancel = true.

Best regards,
Haneef

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.

;