Category / Section
How to create ReadOnly UnboundRows?
1 min read
The SfDataGrid allows you to create the ReadOnly UnBoundRows in two ways:
- You can create the Readonly unboundRows by setting the Position and ShowBelowSummary properties of the GridUnBoundRow based on the following table summary.
Position | ShowBelowSummary | Is Unbound Row Editable |
Top | False | Not Editable |
Top | True | Editable |
Bottom | True | Not Editable |
Bottom | False | Editable |
XAML
<Syncfusion:SfDataGrid> <Syncfusion:SfDataGrid.UnBoundRows> <Syncfusion:GridUnBoundRow Position="Top" ShowBelowSummary="False"/> <Syncfusion:GridUnBoundRow Position="Bottom" ShowBelowSummary="True"/> </Syncfusion:SfDataGrid.UnBoundRows> </Syncfusion:SfDataGrid>
- You can cancel the editing of the unbondrows by handling the CurrentCellBeginEdit event.
using Syncfusion.UI.Xaml.Grid; SfdataGrid.CurrentCellBeginEdit += SfdataGrid_CurrentCellBeginEdit; void SfdataGrid_CurrentCellBeginEdit(object sender, CurrentCellBeginEditEventArgs args) { if (SfdataGrid.IsUnBoundRow(args.RowColumnIndex.RowIndex)) { args.Cancel = true; } }
Sample Links: