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

GridDataBoundGrid - readonly as well as editable rows

Thread ID:





33207 Aug 16,2005 10:12 AM UTC Aug 16,2005 02:17 PM UTC WinForms 3
Tags: GridControl
Santha Kumar
Asked On August 16, 2005 10:12 AM UTC

I have a requirement in GridDataBoundGrid, some rows I want to be editable and some rows I want it to be readonly. Is there a way I can make the row as readonly or editable based on condition. Guide me to achieve this.

Administrator [Syncfusion]
Replied On August 16, 2005 11:51 AM UTC

You can handle the grid.Model.QueryCellInfo event. There you can set e.Style.ReadOnly = true based on what ever condition you want to use. You would need to set e.Style.ReadOnly = true anytime e.RowIndex points to a row you want to be readonly.

Santha Kumar
Replied On August 16, 2005 01:17 PM UTC

In dbgHolders_QueryCellInfo, I have set the individual cell to readonly when the data is fetched from database with e.Style.ReadOnly = True Note: Some of the columns are editable. Now the requirement is 1. User should not be allowed to delete the existing row (which are fetched from database) 2. user should be allowed to delete the new row added before saving it. Let me know the way i can achieve this.

Administrator [Syncfusion]
Replied On August 16, 2005 02:17 PM UTC

You can set this property to prevent rows from being removed. this.gridDataBoundGrid1.Binder.EnableRemove = false; While the user is editing the AddNew row, he can press esc once to cancel the edit on the currentcell. If he presses esc twice (or ther eis no actively editing currentcell & he presses it once), then the edit on the new record is cancelled (removing the new AddNew record and emptying the one that was being edited).


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