G GGS Member Licensed User Longtime User May 20, 2014 #1 I need to retrieve the row number currently selected in a table when the user clicks a button. Multi-select is not enabled so I just need one row (not a list). It seems like this should be very simple, but I can't figure it out. Is there something like this: Code: Copy Dim a as Int a = TableView.SelectedRow Any help is greatly appreciated. Thanks, GGS
I need to retrieve the row number currently selected in a table when the user clicks a button. Multi-select is not enabled so I just need one row (not a list). It seems like this should be very simple, but I can't figure it out. Is there something like this: Code: Copy Dim a as Int a = TableView.SelectedRow Any help is greatly appreciated. Thanks, GGS
klaus Expert Licensed User Longtime User May 20, 2014 #2 Three solutions: 1) Add this routine in the Table class: Code: Copy 'Returns the selected row, or the first selected row in MultiSelect mode Sub getSelectedRow Return SelectedRows.Get(0) End Sub And in your code a =TableView.SelectedRow 2) Code: Copy Dim SelRows as List SelRows = TableView.SelectedRows a = SelRows.Get(0) 3) Add a TableView_CellClick event routine in your code and handle The SelctedRow yourself. Not tested, but should work. Upvote 0
Three solutions: 1) Add this routine in the Table class: Code: Copy 'Returns the selected row, or the first selected row in MultiSelect mode Sub getSelectedRow Return SelectedRows.Get(0) End Sub And in your code a =TableView.SelectedRow 2) Code: Copy Dim SelRows as List SelRows = TableView.SelectedRows a = SelRows.Get(0) 3) Add a TableView_CellClick event routine in your code and handle The SelctedRow yourself. Not tested, but should work.
G GGS Member Licensed User Longtime User May 20, 2014 #3 Klaus, Thank you for your help! GGS Upvote 0