[Gambas-user] Gridview sort function

T Lee Davidson t.lee.davidson at ...626...
Tue Dec 23 19:12:04 CET 2014


This code:

Public Sub TableView1_ColumnClick(Column As Integer)

      TextBox1.Text = "column = " & Column & " sort = "
      If TableView1.Columns.Sort Then
           TextBox1.Text &= "Asc"
      Else
           TextBox1.Text &= "Desc"
      Endif
End

uses the wrong property.

TableView1.Columns.Sort sets or returns the index of the column that displays the sort indicator, not whether any particular column is sorted 
ascending or descending.

Try, "If TableView1.Columns.Ascending Then" instead.


Lee
__________

"Artificial Intelligence is no match for natural stupidity."

On 12/23/2014 12:08 PM, bill-lancaster wrote:
> Thanks for that Lee,
>
> Please see the attached example.  The result of the column_click event does
> not agree with the results of button1_click which reports on the state of
> .Ascending.  In fact after two column_clicks there is no change of state
> with the Ascending property with the column_click event.
>
> Any thoughts?
>
> Gambas 3.5.3
> Kubuntu 14.04 TableviewExample-0.gz
> <http://gambas.8142.n7.nabble.com/file/n49866/TableviewExample-0.gz>
>
>




More information about the User mailing list