Home - Forums-.NET - FlyGrid.Net (Windows Forms) - I need help with the simplest things

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

I need help with the simplest things
Link Posted: 30-Aug-2005 02:00
My company has decided that we will use flygrid.

Aside from the demo, I can't make flygrid do anything.  ANYTHING!

I have given up on loading data from a datatable and now I'm trying unbound.  Can someone show me code to add a row to this grid????

The other programmers are waiting for me to figure it out.  I'm afraid I'm going to lose my job (or get beat up in the parking lot) if I can't get this grid to work soon.  

I have v1.0.10

Thanks!
Link Posted: 30-Aug-2005 03:18
Please download latest FlyGrid and see the Bound features group samples.
1. You can set FlyGrid.Options.ShowNavigationBar:

flyGrid.Options |= GridOptions.ShowNavigationBar;

to show records navigation bar and use navigation bar buttons (MoveFirst, Move to Previous Page, Move to Previous Record, Move to to Next Record, Move to Next Page, Move to the End, Add new record, Delete current record).

2. You can use AddNew row, to add new row set the flyGrid.Rows.Options.ShowAddNewRow to true:

flyGrid.Rows.Options |= RowsOptions.ShowAddNewRow;


3. You can add new row programmatically, on the data source:


//Get data view
DataView myDataView = GetData();
//connect to data view
flyGrid.Rows.DataSource = myDataView;
...
DataRowView drv = dataView.AddNew();
drv["MyData"] = "something";
drv.EndEdit();


In this case FlyGrid will handle changes made in the Datasource object and reflect changed/added data;
Link Posted: 30-Aug-2005 03:23
How to add new row in unbound mode:
flyGrid.BeginInit();
try
{
  Node newNode = new Node(new object[]{"firstCol", "secondCol", 3, "thirdCol", someImageList.Images[4]});
  flyGrid.Rows.Items.Add(newNode)
}
finally
{
  flyGrid.EndInit();
}