FlexGrid for WinForms Task-Based Help > Populating an Unbound Grid with Data > Populating a Row with Data |
To populate a row with data when the form loads, set a loop with the grid's indexer to the data to fill the row. Add the following code to the Form_Load event to set column one to zero:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim r As Integer For r = C1FlexGrid1.Cols.Fixed To C1FlexGrid1.Cols.Count - 1 Me.C1FlexGrid1(1, r) = 0 Next |
To write code in C#
C# |
Copy Code
|
---|---|
int r; for (r = c1FlexGrid1.Cols.Fixed; r <= c1FlexGrid1.Cols.Count -1;r++) { this.c1FlexGrid1[1, r] = 0; } |
Row one fills with zeros.