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

GridDataBoundGrid - readonly as well as editable rows

Thread ID:

Created:

Updated:

Platform:

Replies:

33207 Aug 16,2005 06:12 AM Aug 16,2005 10:17 AM Windows Forms 3
loading
Tags: GridControl
Santha Kumar
Asked On August 16, 2005 06:12 AM

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 07:51 AM

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 09:17 AM

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 10:17 AM

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).

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

;