diff --git a/README.md b/README.md index 04bbe7f..d179ddf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ -# How to add a new row in winforms datagrid when datagrid bound to datatable? -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. +# How to Add a New Row in WinForms DataGrid When DataGrid Bound to DataTable? -``` +This sample illustrates how to add a new row when [WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid) bound to DataTable. + +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. + +``` csharp DataTable gridDataTable = this.sfDataGrid.DataSource as DataTable; if (gridDataTable == null || this.sfDataGrid.View == null) return; @@ -18,5 +21,4 @@ addNewRow.SetField(1, gridDataTable.Rows[0][1]); addNewRow.SetField(2, gridDataTable.Rows[0][2]); addNewRow.SetField(3, gridDataTable.Rows[0][3]); addNewRow.SetField(4, gridDataTable.Rows[0][4]); - -``` \ No newline at end of file +```