ColumnView data into column cell...

Post

Posted
Rating:
#1 (In Topic #1373)
Regular
chrisRoald is in the usergroup ‘Regular’
Hi,
    I seem to be missing the flamingObvious here, as I've added an item to my columnView control and added a column with title, but can't figure out how to add text data to the column cell of my added item??!!

Image

(Click to enlarge)


Thanks,
C.
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
access columnview / gridview cells via the array
/comp/gb.qt4/gridview/_get - Gambas Documentation

ColumnView is just an enhanced GridView so the examples on this page should help
/comp/gb.qt4/gridview - Gambas Documentation

Code (gambas)

  1.  
  2. Dim iRow As Integer = ColumnView1.Row
  3. Dim iCol As Integer = 0
  4.  
  5. ColumnView1[iRow, iCol].Text = "This text"
  6.  
  7.  
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Regular
thatbruce is in the usergroup ‘Regular’
Also, when you add a new row item ColumnView1.Item points to the current row and is accessible as an "array of columns, so

Code (gambas)

  1. Public Sub Form_Open()
  2.  
  3.   ColumnView1.AddColumn("Column-1", -1, Align.Left)
  4.  
  5.   ColumnView1.Add("K0", "Group 1", Picture["icon:/32/administrator"])
  6.   ColumnView1.Item[1] = "Here's one"
  7.  
  8.  
Image

/home/bb/.cache/shutter/unsaved/Labelled controls 2024 version_001.png

/home/bb/.cache/shutter/unsaved/Labelled controls 2024 version_001.png

(Click to enlarge)


b

Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
chrisRoald is in the usergroup ‘Regular’
Thanks All,
     Learning new every day!  
        ~ including in the documentation -
This class acts like a read-only array
gives examples  :o . https://gambaswiki.org…omp/gb.qt4/_treeview/_get
wot I was skipping over, of course :roll:

Regards,
C.
Online now: No Back to the top
1 guest and 0 members have just viewed this.