[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gambas-user
Subject:    Re: [Gambas-user] ColumnView: how to add text to columns (Gambas 2)
From:       Rolf-Werner Eilert <eilert-sprachen () t-online ! de>
Date:       2011-02-22 17:24:58
Message-ID: 4D63F16A.8010307 () t-online ! de
[Download RAW message or body]

Am 22.02.2011 17:51, schrieb Anthony Tekatch:
>> ... how to insert text into other columns than column 0.
>>
>> ColumnView1.Add("key1", "Text1") only adds text to the leftmost column,
>> the one that can be shown like a treeview. (I don't need that treeview
>> feature, just several columns.) And how do I add text to column 1, 2
>> etc.?
>
> Here is an example. I am using a ColumnView called ProductsList
>
> In the Form_Open do, I do this:
>
>    ProductsList.Columns.Count = 4
>    ProductsList.Header = 1 'show header
>    ProductsList.Mode = Select.Single
>    ProductsList.Columns[0].Text = "ID"
>    ProductsList.Columns[1].Text = "Act"
>    ProductsList.Columns[2].Text = "Des"
>    ProductsList.Columns[3].Text = "Description"
>
>
> The to populate the entire Columnview, here is part of the code used:
>    ...
>    ctr = 1
>    FOR EACH Result
>      ProductsList.Add(ctr, Result!product_id)
>      ProductsList[ctr][1] = Result!actual_stock
>      ProductsList[ctr][2] = Result!desired_stock
>      ProductsList[ctr][3] = Result!description
>      INC ctr
>      IF ctr>  1000 THEN BREAK
>    NEXT
>    ...
>
>
> So as you can see, your "Add" adds an entire row. The you can use array
> identifiers to address and set the column values. Probably like this:
>   ColumnView1["key1"][1] = "Text A"
>   ColumnView1["key1"][2] = "Text B"
>


Aaaaah - ok :-)

Now it works!

Thanks a lot - have a nice evening, Anthony.

Regards

Rolf


------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic