New topic: Expandable ListBox - Child Rows Empty
<http://forums.realsoftware.com/viewtopic.php?t=38738> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message DogPaws Post subject: Expandable ListBox - Child Rows EmptyPosted: Sat Apr 23, 2011 7:38 am Joined: Sat Nov 10, 2007 11:35 am Posts: 93 I spent some time looking over the LR example code for expandable ListBoxes and after a bit of time I got how it works. I even put that code into a test project so I could prove to myself that it actually worked fine. So I am having a problem with my own expandable ListBox: I have one parent row in my ListBox, which has always worked fine. I built the code to add two child rows to the parent row. The parent row displays fine. The disclosure triangle appears and when you click on it, two child rows appear but they are blank. You can click on the "blank" sub rows and they become highlighted. I cannot figure out why they rows are there but are blank. They don't contain the test values I am placing in each row. I even tried reducing my parent row to one column (not counting the column that has the hidden child values), thinking that perhaps you could only expand rows if you were dealing with one column (as in the LR example.) However, doing this didn't work and I later realized it doesn't make any sense anyway as it appears that the child rows are really just a 'regular" ListBox row anyway and RS should not care how many 'display' rows the parent and child rows have (I hope the foregoing makes sense.) So here is my code that results in the two empty sub rows: [Note that I don't even have any DB queries in the child rows I left them out for troubleshooting purposes] [Note that Some objects/values have been renamed to protect the client's info] [Note that the ListBox is set to hierarchical in the IDE.] [Note that the ColumnCount property is set to 6] Code: Window1.MyListbox.Open ---------------------- Me.ColumnWidths = "5%,7%,31%,31%,26%,0" Me.Heading(0) = "ID" Me.Heading(1) = "Status" Me.Heading(2) = "Column Label 100" Me.Heading(3) = "Column Label 200" Me.Heading(4) = "Column Label 300" //Note that the code to create the parent row is in a BevelButton action event Window1.MyBevelButton.Action ---------------------------- //This call to .AddFolder creates the //hierarchical relationship Window1.MyListbox.AddFolder "" //Adds the "sub-list" row items Window1.MyListbox.Cell(Window1.MyListbox.LastIndex, 5) = "test1 ; test2" //Adds each data element to the main //row in the ListBox Window1.MyListbox.Cell(Window1.Listbox.MyLastIndex, 0) = r.Field("ID").Value Window1.MyListbox.Cell(Window1.Listbox.MyLastIndex, 1) = t Window1.MyListbox.Cell(Window1.Listbox.MyLastIndex, 2) = r.FIeld("value100").Value Window1.MyListbox.Cell(Window1.Listbox.MyLastIndex, 3) = r.Field("value100").Value Window1.MyListbox.Cell(Window1.Listbox.MyLastIndex, 4) = r.Field("value300").Value Window1.MyListbox.ExpandRow ---------------------------- Dim s as String Dim i as Integer s = Me.Cell(row,5) For i=1 to 2 Me.AddRow "" Me.Cell(Me.LastIndex,0)= NthField(s,";",i) Next Window1.MyListbox.DoubleClick ---------------------------- Me.expanded(Me.listindex)=Not Me.expanded(Me.listindex) I also note that when debugging I can see in the IDE that the child row values are being populated in the first column; they are just not displaying. Any help will be greatly appreciated. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
