[Gambas-user] Query for sorting not work

T Lee Davidson t.lee.davidson at gmail.com
Mon Sep 5 18:16:24 CEST 2022


On 9/5/22 08:43, gian via User wrote:
> Hi,
> 
> I avoid saying to whom the question is addressed so as not to appear like a stalker.
> 
> I have noticed that if the last column is sorted ascending and I have to sort another column, it immediately sorts in ascending 
> mode, conversely if the previous column was sorted descending, the new column is first sorted descending and then is correctly 
> sorted ascending.
> 
> In the hope that I have explained myself, I ask if this is correct or is it a malfunction?
> 
> Thank you
> 
> Gianluigi

Gridview.Columns.Ascending is a property of Columns, so it would have to behave as a toggle for *all* columns. If you want the 
default sort order for a click on a different column to be ascending, you can modify your Column click event handler thus:

Public Sub GridView1_ColumnClick(Column As Integer)

   If $iCurrentColumn <> Column Then
     GridView1.Columns.Ascending = True
     $iCurrentColumn = Column
   Endif

End


-- 
Lee


More information about the User mailing list