Equally it would be useful for Insert data into ListTrees as well.
So here is the scenario, ListView on the left, Column Titles... with Add/Remove buttons underneath to allow user to add rows of data.
The ListView on the right needs to react by adding and removing columns depending on the number of rows in the left-hand list view.
Furthermore the ListView on the right has buttons below for Adding and Removing rows of data.
So yeah very complicated, here's my ancient code that I need to refactor and figure out how I am going to make this work.
I wrote this over a year ago and I see here I that I have fixed the number of column titles to a maximum of 5; but hey I don't want restriction!
Code: Select all
If GetType(obj.rows[c][4]) <> #NIL
For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0], obj.rows[c][1],obj.rows[c][2],obj.rows[c][3],obj.rows[c][4])
ElseIf GetType(obj.rows[c][3]) <> #NIL
For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0], obj.rows[c][1],obj.rows[c][2],obj.rows[c][3])
ElseIf GetType(obj.rows[c][2]) <> #NIL
For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0], obj.rows[c][1],obj.rows[c][2])
ElseIf GetType(obj.rows[c][1]) <> #NIL
For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0], obj.rows[c][1])
ElseIf GetType(obj.rows[c][0]) <> #NIL
For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0])
EndIf
It doesn't look like I will be able add columns to the ListView on the right either so will have to do the initchange, exitchange on the entire object and re-populate any entries in the table as there is no AddColumn, RemoveColumn methods... going to get messy.