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.

Editable and Readonly column

Thread ID:

Created:

Updated:

Platform:

Replies:

45542 Jun 22,2006 05:52 PM Jun 22,2006 06:20 PM Windows Forms 1
loading
Tags: GridControl
shailaja
Asked On June 22, 2006 05:52 PM

Hi, Am adding a new row to the grouping grid on click of a button.In this new row,I need to make only the 3rd column editable and the remaining readonly. I am able to achieve this partially by using grd1_QueryCellStyleInfo event and making : if(e.TableCellIdentity .ColIndex == 3) e.Style.ReadOnly = false; The problem is that then the 3rd column of ALL the rows become editable. Doing (e.TableCellIdentity .RowIndex== 0 && e.TableCellIdentity .ColIndex == 0) doesnt work.

Administrator [Syncfusion]
Replied On June 22, 2006 06:20 PM

Hi Sh, Regarding AddNewRecord : Could you try this code in QueryCellInfo event to make a cell as readonly cell in a grid. Here is a code snippet. if(e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.AddNewRecord ) { if(e.TableCellIdentity.ColIndex == 3) { e.Style.Readonly = false; } else e.Style.Readonly = true; } Regarding Newly Added Record: You need to handle the SourceListRecordChanging event to find the newly added record and set the readonly property of the record in QuerycellInfo event. Please find the code snippet. Record NewRecord = null; private void gridGroupingControl1_SourceListRecordChanging(object sender, Syncfusion.Grouping.RecordChangedEventArgs e) { if( e.Action = RecordChangedType.Added ) { NewRecord = e.Record; } } if( NewRecord != null && NewRecord == e.TableCellIdentity.DisplayElement.ParentRecord) { if(e.TableCellIdentity.ColIndex == 3) { e.Style.Readonly = false; } else e.Style.Readonly = true; } Here is a sample. http://www.syncfusion.com/Support/user/uploads/AddNewRecord_994b98ae.zip Let me know if this helps. 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.

;