Skip to content

Commit 8c947e1

Browse files
authored
Merge pull request #3 from SyncfusionExamples/ES-975464
ES-975464 - Resolve the ReadMe file length issue in this sample repository
2 parents 8ed58ed + 30fd097 commit 8c947e1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# How to add a new row in winforms datagrid when datagrid bound to datatable?
2-
You can add the new row programmatically from a DataTable to the SfDataGrid by creating a new row in the `SfDataGrid.View` and set required value for that row.
1+
# How to Add a New Row in WinForms DataGrid When DataGrid Bound to DataTable?
32

4-
```
3+
This sample illustrates how to add a new row when [WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid) bound to DataTable.
4+
5+
You can add the new row programmatically from a `DataTable` to the `DataGrid` by creating a new row in the [SfDataGrid.View](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.SfDataGrid.html#Syncfusion_WinForms_DataGrid_SfDataGrid_View) and set required value for that row.
6+
7+
``` csharp
58
DataTable gridDataTable = this.sfDataGrid.DataSource as DataTable;
69
if (gridDataTable == null || this.sfDataGrid.View == null)
710
return;
@@ -18,5 +21,4 @@ addNewRow.SetField(1, gridDataTable.Rows[0][1]);
1821
addNewRow.SetField(2, gridDataTable.Rows[0][2]);
1922
addNewRow.SetField(3, gridDataTable.Rows[0][3]);
2023
addNewRow.SetField(4, gridDataTable.Rows[0][4]);
21-
22-
```
24+
```

0 commit comments

Comments
 (0)