Selecting a row in a TableListBox?


#1

I’d like to select a row of my TableListBox programatically on startup. Is there a method to do that? I was looking for something like selectRow() that’s in the ListBox class, but I’m not seeing anything.

I’m probably just blind. Could someone turn on the light and show me the way?


#2

I’ll post a follow-up because I’ve hit another point where I’d like to be able to set the selected row myself.

The rows of my TableListBox are selectable, and draggable, so you can re-arrange the order as in iTunes. After dragging row 1 over row 5, row 1 should insert itself after row 5, and end up selected.

I can handle the re-arrangement within my data model, but the TableListBox still thinks that row 1 is selected, because that was the last row I clicked on. How can I force the TableListBox to recognize the old row 1 as being the currently selected row after the drag?


#3

[quote]I’d like to select a row of my TableListBox programatically on startup. Is there a method to do that? I was looking for something like selectRow() that’s in the ListBox class, but I’m not seeing anything.
[/quote]

erm… TableListBox is a ListBox, so you can call selectRow() on it!