Determine selected column of datagrid

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
ElZitouni
Posts: 40
Joined: Sun Oct 14, 2012 10:43 pm

Determine selected column of datagrid

Post by ElZitouni » Mon Oct 17, 2016 3:02 pm

Hello,
I would like to determine which column, if any, is currently selected in a datagrid. That is, what column is the current sorting column.
Looking at the LiveCode Data Grid PDF did not bring up much (I might have overlooked something).
Thank you for your help.
Olli.

ElZitouni
Posts: 40
Joined: Sun Oct 14, 2012 10:43 pm

Re: Determine selected column of datagrid

Post by ElZitouni » Wed Oct 19, 2016 11:57 pm

After scrutinizing the datagrid documentation, I found the table property that contains the column used for sorting.

this here

put the dgProps["sort by column"] of group "Data Grid" into lCurrentlySelectedColumn

will get you the name of the column used for sorting, and thus the one of which the user clicked the header.

Post Reply