Page 1 of 1

locking sort in a dataGrid column

Posted: Wed May 02, 2012 12:32 am
by dunbarx
I want to lock the user out of being able to sort columns in a DG.

I can set the "sort by column" in the inspector to "false"

and I can:

set the dgColumnIsEditable["fade"] of grp "queue1" to "false",

but neither of these has any effect. If I click in the column header, a sort triangle appears, and the column is then sortable. Resetting from the inspector makes the sort arrow go away. Great. Is there no "lock" gizmo with teeth? Is this a bug?

I guess I can place a transparent object over the column headers, and head them off at the past.

Thanks.

Craig Newman

Re: locking sort in a dataGrid column

Posted: Wed May 02, 2012 10:44 am
by Klaus
Hi Craig,

verified with LC 5.02, the settings "Sort by column" is being ignored for ALL columns if you click the headers, big fun :-/
Looks like a bug, please write to: bugs@runrev.com


Best

Klaus

Re: locking sort in a dataGrid column

Posted: Wed May 02, 2012 11:17 pm
by snm
Try to put handler:

on SortByColumn
end SortByColumn

in group "yourDataGrid"

Marek

Re: locking sort in a dataGrid column

Posted: Wed May 02, 2012 11:36 pm
by Zryip TheSlug
dunbarx wrote:I want to lock the user out of being able to sort columns in a DG.

I can set the "sort by column" in the inspector to "false"

and I can:

set the dgColumnIsEditable["fade"] of grp "queue1" to "false",

but neither of these has any effect. If I click in the column header, a sort triangle appears, and the column is then sortable. Resetting from the inspector makes the sort arrow go away. Great. Is there no "lock" gizmo with teeth? Is this a bug?

I guess I can place a transparent object over the column headers, and head them off at the past.

Thanks.

Craig Newman
Hi Craig,

This is definitively not a bug.

The "sort by column" option in the inspector, allows to sort the datagrid by a specific column by default or to remove any default column sorting. Unchecking the check box, not disable the ability to sort a column in the datagrid by clicking on its header.

The correct way to really lock the column header is to add this handler in the datagrid group:

Code: Select all

on SortDataGridColumn pColumn
  ## Remain this handler empty for disabling the sort capability of a datagrid
end SortDataGridColumn

Best Regards,

Re: locking sort in a dataGrid column

Posted: Thu May 03, 2012 2:15 am
by dunbarx
Thanks to both of you.

I checked the messageWatcher when clicking in a header, and among the 3000 messages sent, I see both " SortByColumn" and "SortDataGridColumn".

Dead giveaways. Trap and forget.

Craig

Re: locking sort in a dataGrid column

Posted: Thu May 03, 2012 8:26 am
by snm
Hi Zryip,

Long time without new futures in DGH. Maybe next small but usefull is to click outside of DG or on header bar to "unsort"?

And second one - small graphics after last column header to trigger Sorting on/off while still have possibility to select column.

And one more thanks for "UTF-8" in DG field editor - it's still not native implemented in LC5.5

Marek