Table component: Get user clicked row

Recommended Posts

That said, you could try and render your own table out of variable value controls. Then you could do it. It would be a little more combursome to create and would work a little different than a standard table (probably with scroll buttons instead of a slider), but would achieve the same thing. In some ways, especially for a touch screen, it would probably work better than a table.

Link to comment
Share on other sites

  • 1 month later...


Just saw post while looking for something else, and thought I'd share my solution to same problem

When the user clicks anywhere on the table you can get the coords relative to the table top left, then using the row height you can figure out which row they clicked.

In the table component OnLButtonDown event

Row = Floor((loc[0][1] / RowHeight)) - DisplayTitles

Hope this helps


Link to comment
Share on other sites

  • 3 years later...

if I have table with 50 rows length . and table contents depend on access database . sometimes table contains more than 300 rows, so scroll bar appear with two arrows (moving up and down ). pressing arrow move the table one row 

can I create button act like  scroll bar arrow but by pressing it the table move 50 rows not one  

Link to comment
Share on other sites

Sure.  Give the table component a name.  Then there is a member variable called "topRow" which you can read and write to.  So, assuming your table is called "MyTable", to move forward 50 rows, you'd do:


component.myTable.topRow += 50


to move the other way, do -=

Link to comment
Share on other sites

  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.