enjoyit
2016-04-12T07:56:28Z
Hi,

another day, another question :-)

Is there a way to select a row via the rowkey?

regards...

Edit:

My workaround for now is that i am searching my first column which contains the rowkey and passing the search-result (which is the row-index) to the cellselected-method.
Henrik
2016-04-12T15:08:38Z
I use a hidden column with the rowkey. I find rows via this rowkey-column with FindSearchMatchRow and select the row with curcol/currow or setcurcell.

Cheers!

Henrik
Igor/10Tec
2016-04-12T16:32:07Z
If row mode is on, you can select entire row by making one of its cells selected:

iGrid1.CellSelected(sRowKey, 1) = True

Or you can use the SetCurCell method:

iGrid1.SetCurCell sRowKey, 1
Henrik
2016-04-13T06:22:58Z
Igor, from reading his workaround I think the problem here is that the SetCurCell/CellSelected-methods gives an error if the row is not in the grid. I guess that is why he wants to search for the rowkey. Otherwise I don't see a point searching when he already knows how to select it via the rowkey.
enjoyit
2016-04-13T08:20:20Z
The point is, that I want to select a row with it's individual Row-ID and not with the relative list-ID.
Henrik
2016-04-13T10:36:12Z
Alright. SetCurCell and CellSelected both accept a variant as parameter which means you can choose what you want to pass; The string RowKey or the long RowIndex (assuming Row-ID = RowKey and list-ID = RowIndex).
enjoyit
2016-04-13T10:49:33Z
Ahhhh, the rowkey worked as well... the Problem was, that i passed a integer variable to the cellselected-method... Now it works!
Henrik
2016-04-13T10:52:33Z
Excellent 🙂