Listbox Lastindex is returning incorrect value after inserting a row

[quote=56253:@Joseph Morgan]Karen,

I think you have answered another question that has baffled me for some time. But I couldn’t put into words to ask on this forum.

I have expanded rows and all their children’s rows and all their childrens rows etc… are all expanded…, and all the rows are cell type checkbox.

I have had trouble checking the parent checkbox and having ALL it’s children also receiving cellcheck=true especially when the rows are already expanded. I should be able to then loop through from parent’s listindex to lastindex. Do you think that would work?[/quote]
This is going to be up to you to be able to uniquely identify a row within the listbox (not using it’s index, because that will change as rows are expanded/collapsed). If you can do that, then each child row needs to store the value that identifies their parent row. Only then can you hope to be able to check/uncheck the already-expanded child rows. A database PK is a good candidate for this.

Actually I usually use the rowTag to hold the indent level and put the data object in the CellTag for column 0… In cell action I have the open child look back and find the 1st row that has an indent level one less than it’s row and thus find it’s parent.

Also sometimes I put a weak reference to the parent in the child object

That’s a really good approach, Karen. I like it.