[Gambas-user] Gridview sort function

B Bruen bbruen at ...2308...
Wed Dec 24 23:40:11 CET 2014


On Wed, 24 Dec 2014 11:57:11 -0500
T Lee Davidson <t.lee.davidson at ...626...> wrote:

> Apparently I didn't take enough time, Bill.
> 
> I only tested that the text of the TextBox changed appropriately for a column_click, I did not test clicking Button1.
> 
> You are right. The value of TableView.Columns.Ascending within the Column_Click event does not agree with the value outside of the Column_Click 
> event. I do not understand this behavior.
> 
> So I'd say that either there is something missing in the documentation, or this is a bug. I have attached a modified version of your sample that 
> shows this anomaly more clearly.
> 
> Can anyone else shed some light on this?
> 
> 
> Lee
> __________
> 
> "Artificial Intelligence is no match for natural stupidity."
> 

This may shed a bit of light:

Public Sub TableView1_ColumnClick(Column As Integer)

The "Column" value in the click handler is the newly "selected" column, however the sort values have not been set yet, this happens after the click handler has finished. So you are not correctly displaying the sort values in the TextBox1.

Attached updated project with some more debug info that shows the actual sort values.

After you have waded through that a bit, uncomment lines 11 and 12 which should really confuse you :-)

cheers
Bruce
-- 
B Bruen <adamnt42 at ...626...>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TableviewExample-0.0.1.tar.gz
Type: application/octet-stream
Size: 5533 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20141225/83f65a56/attachment.obj>


More information about the User mailing list