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. Image for the cookie policy date

Paining Grid Cells

Hi,

The data I have in the table bound to a grid is not in the ofrmat I want to display it in. So I use the TableControlDrawCellDisplayText event and it works fine except when I clisck on the cell. These sells are read only but it still seems to go into a edit mode and display the raw text.

Do you know how I can prevent this?

Thanks!

WJL

2 Replies

HA haneefm Syncfusion Team October 18, 2007 10:39 PM UTC

Hi Bill,

To make the cell readonly, you can use this handler to prevent the edit cursor from showing. Please try this code to see if it does what you need.

private void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.Model[cc.RowIndex, cc.ColIndex];
if(style.ReadOnly)
e.Inner.Cancel = true;
}

Best regards,
Haneef


BL Bill Langlais October 19, 2007 02:09 AM UTC

Hi,

That worked great!!!

Thanks Haneef!

WJL

>Hi Bill,

To make the cell readonly, you can use this handler to prevent the edit cursor from showing. Please try this code to see if it does what you need.

private void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.Model[cc.RowIndex, cc.ColIndex];
if(style.ReadOnly)
e.Inner.Cancel = true;
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon