pio

Table component: Get user clicked row

Recommended Posts

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.

Share this post


Link to post
Share on other sites

No, not with a table control. You could do it with a tree control to create a what is generally called a list box, but that only would have one column.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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  

Share this post


Link to post
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 -=

Share this post


Link to post
Share on other sites

this function working on pages. I need to do on popup. How can I do?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now