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.
Syncfusion Feedback

Paining Grid Cells

Thread ID:

Created:

Updated:

Platform:

Replies:

69210 Oct 18,2007 03:39 PM UTC Oct 19,2007 02:09 AM UTC Windows Forms 2
loading
Tags: GridControl
Bill Langlais
Asked On October 18, 2007 03:39 PM UTC

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

haneefm [Syncfusion]
Replied On 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

Bill Langlais
Replied On 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

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

;