Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Add row with Databound Grid

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Add row with Databound Grid
Link Posted: 02-Aug-2006 05:19
Hi,
I use FlyGrid as Databound Grid.

I created a Button on my Form \"Add Row\"

When I press this button I want to add a empty row for adding a new record into the Gird on the top of the Grid.

How may I do this ?

Thanks and regards
Uwe
Link Posted: 02-Aug-2006 09:19
To add new row in databound mode you can use following code:
[c#]
flyGrid.ActivePort.AddNewRow();
Link Posted: 02-Aug-2006 10:11
I add this code.

When I now hit the button, the last Row is shown but no new Row for editing is available.


My view is set to AllowNew.

Is there a possible switch in the grid wich disallow adds ?

Thanks and regards
Uwe
Link Posted: 02-Aug-2006 10:41
1. You can use ButtonBar of the FlyGrid and click on NewRow button to add new row (see the any of Data Bound samples).
2. You can add new row to the dataview or datatable that bound to the FlyGrid to add new row.
3. You can turn on RowsOptions.ShowAddNewRow option to flyGrid.Rows to show NewRow row to add new row after filling data in this row.

Is there a possible switch in the grid wich disallow adds ?

You can turn off RowsOptions.ShowAddNewRow from flyGrid.Rows to disallow additions by this way and hide FlyGrid's ButtonBar - by turning off GridOptions.ShowNavigationBar option from flyGrid.Options.