Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Get all rows values in flygrid...

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

Get all rows values in flygrid...
Link Posted: 10-Aug-2005 03:25
What I have is a flygrid with three columns and any number of rows. The three rows are 1) name 2) description 3) value  what I would like to do is loop through every row in the flygrid and hold the information in every column.

Somthing like this (not correct code just wanted to give an example of what I would like to acheive)



dim i as integer
dim strName as string
dim strDesc as string
dim strValue as string

do i = 0 to me.flygrid1.rows.count
strName = me.flygrid1.column(0).row(i)
strDesc = me.flygrid1.column(1).row(i)
strValue = me.flygrid1.column(2).row(i)
next i



Thanks in advance

Simon
Link Posted: 11-Aug-2005 05:22
to collect all row values use follwing code:

C#:
object[] rowValues = new object[flyGrid.Rows.Items.Count]
int
for (int i =0; i< rowvalues.Length; i++)
{
  //retrieve whole row value, it is may be array of values/cells
  rowValues[i] = flyGrid.Rows.Items[i].Value;
}


to retreive some cells from rows:


C#:
string strName, strDesc, strValue;
foreach(NodeBase node in flyGrid.Rows.Items)
{
  strName = flygrid1.columns.Items(0).GetValue(node);
  strDesc = flygrid1.columns.Items(1).GetValue(node);
  strValue = flygrid1.columns.Items(2).GetValue(node);
}
Link Posted: 09-Aug-2007 02:15
Are you able to supply the below code in vb.net, as I have tried converting it but with no success.

Thanks in advance

Simon