Articles in this section

How to restrict the editing of specific cells in WinForms GridGroupingControl?

Restrict the editing of specific cell


In WinForms GridGroupingControl, to restrict the cells from editing only in specific scenarios like using dynamic filter with expressions (GridDynamicFilter), make use of the QueryCellStyleInfo event and validate the condition that ReadOnly property should be false only if it is FilterBar CellType.


C#

void hierarchyGrid_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
     //stop user from editing the contents of the grid cell
     e.Style.ReadOnly = (e.TableCellIdentity.TableCellType == GridTableCellType.FilterBarCell)? false : true; 
}

VB

Private Sub hierarchyGrid_QueryCellStyleInfo(ByVal sender As Object, ByVal e As GridTableCellStyleInfoEventArgs)
    ' Stop user from editing the contents of the grid cell
    e.Style.ReadOnly = If(e.TableCellIdentity.TableCellType = GridTableCellType.FilterBarCell, False, True)
End Sub
The screenshot below illustrates the restriction of editing for the specific cell in the GridGroupingControl.

Restrict the editing for all cells except filter cell in WinForms GridGroupingControl

 

Search the font style in WinForms GridGroupingControl

 

Conclusion

I hope you enjoyed learning about how to restrict the editing of specific cells in WinForms GridGroupingControl.

You can refer to our WinForms GridGroupingControl’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms GridGroupingControl documentation to understand how to present and manipulate data.

 For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms GridGroupingControl and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you! 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied