The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.
ADAdministrator Syncfusion Team 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.
SKSantha KumarAugust 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.
ADAdministrator Syncfusion Team 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).