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

Editable and Readonly column

Thread ID:





45542 Jun 22,2006 09:52 PM UTC Jun 22,2006 10:20 PM UTC WinForms 1
Tags: GridControl
Asked On June 22, 2006 09:52 PM UTC

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 10:20 PM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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