Table component: Get user clicked row


Recommended Posts

Posted

Hi,

I have a table with approx. 100 rows and 10 columns, and I need to get the index of user-clicked-row.

Can I do it in DAQ?

I am using DAQ 5.84 Developer version.

Any help would be appreciated.

Posted

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.

  • 1 month later...
Posted

Hi,

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

Cheers

  • 3 years later...
Posted

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  

Posted

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 -=

  • 4 years later...
Posted

OnMouseMove function I put script "global Row4 = loc[0][1]"

Row4 is change on pages. but when I open popup it is not changing.

Also when popup is open, outside the popup page it is working. but I need to X and Y on popup.

Archived

This topic is now archived and is closed to further replies.