[Gambas-user] How to find which row you are on in multicolumn list

Stefano Palmeri rospolosco at ...152...
Tue Feb 5 10:26:28 CET 2008


Alle 22:43, lunedì 4 febbraio 2008, richard terry ha scritto:
> Yes, I do try, I've stuffed around with this for over an hour, really
> really did read the docs.
>
> All I want to do is to detect which row is being clicked on in the list 
> and despite having all these things to play with below cut and pasted and
> out of order from the doc's, I can't figure it out:
> =================================================
> Properties     Methods     Events
>   AutoResize  Available  Border  ClientH  ClientHeight  ClientW 
> ClientWidth Columns  Compare  Count  Current  Editable  Header  Item  Key 
> Mode Resizable  ScrollBar  Settings  Sorted       Add  Clear  Exist  Find
> MoveAbove  MoveBack  MoveBelow  MoveChild  MoveCurrent  MoveFirst  MoveLast
> MoveNext  MoveParent  MovePrevious  MoveTo  Remove  SelectAll      
> Activate Cancel  Click  Collapse  Compare  Expand  Rename  Select
> ==================================================
>
> When one puts in data it goes in in the form of  row,col
>
>  cvPerson[irows][0] = $Result!surname
> cvPerson[irows][1] = $Result!firstname
>
> I want when I later click on a row to be able to get the 'irows' equivalent
> integer back again.
>
> Sorry for being so............. dumb.
>
> Richard
>

Hi. 
I have a dirty stupid solution:
index you items with progressive numbers.

I've attached an example. 

Also, if you need your keys to be more explicit that just a number, you could 
prepend your descriptive key with a progressive number. 

Example:

columnview1.add(columnview1.count & " " & "descriptive_key", "here_item") 

so you always know that the first part of ColumnView1.Current.Key is 
the row number.

I've attached a little example.

Stefano

> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: currentRow-0.0.1.tar.gz
Type: application/x-tgz
Size: 7978 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20080205/2001da0e/attachment.bin>


More information about the User mailing list