user926367
user926367

Reputation:

Janus GridEx: Add custom row and select a specific row

I have GridEx object on my form and...

  1. I want to add some items in it with a for...next loop. Actually I couldn't find any method for adding a new row with a custom data.

  2. I want to select a specific row in that GridEx object. For example: I want to select the 6th row, is there anything like mygrid.rows(6).value or something like that?!

Thanks in Advance...

Upvotes: 3

Views: 18706

Answers (2)

Mentor
Mentor

Reputation: 111

To add new row to gridex called MyGridEX:

object[] data = { "value0", "value1", "value2", ... };
this.MyGridEX.AddItem(data);

To select a specific row:

this.MyGridEX.GetRow(1); // select the second row

Upvotes: 2

Ben Hoffstein
Ben Hoffstein

Reputation: 103365

Assuming you have a GridEX control called grid...

To add new data:

GridEXRow row = grid.AddItem();
row.BeginEdit();
row.Cells[0].Value = "Whatever"; // refer to columns by index or name
...
row.EndEdit();

To retrieve a specific row:

GridEXRow row = grid.GetRow(5); // returns the 6th row

To select a specific row:

grid.MoveTo(5); // moves the selection to the 6th row

Upvotes: 6

Related Questions