I have a UltraWinGrid that uses an UltraDataSource containing band 0 and a single child band (Band 1). On the Grid, I set the row selection is to be limited to a single row in band 0. What I'm looking for is when I select a row in Band 0, I want its Band 1 to be the only one expanded in the UltraDataGrid.
Thank you
Tess1243 said:But how to store that row which has been expanded ??
Store the row itself in a member variable on the form of type UltraGridRow.
Tess1243 said:And what do you think is the best event to write the code for Expanding or Collapsing?
I think the AfterRowExpanded event is what I would use.
Tess1243 said:Can I write this in the RowInitialize Event.
I don't see how InitializeRow would work for what you want here.
Hello Mike,
Even I have the same Problem to work on. I got your point.
But how to store that row which has been expanded ??
And what do you think is the best event to write the code for Expanding or Collapsing?
Can I write this in the RowInitialize Event.
Hi Clay,
There's nothing built-in to the grid to only keep one row expanded at a time. But you could implement this very easily as Brian suggested.
You cannot collapse Band1, though. The Expanded or collapsed state it a function of the parent row, not of the child band.
The grid fires events when a row is expanded or collapsed: BeforeRowExpanded/AfterRowExpanded, BeforeRowCollapsed/AfterRowCollapsed.
So you could use AfterRowExpanded to keep trap of when a row is expanded and store that row. The next time a row is expanded, you can call the Collapse method on the previously-expanded row.
Hello
I'm sorry but I don't understand your reply. There is no command to colapse just 1 row and the collapseall doesn't give me what I'm looking for. Let me restate the problem.
I have band0 that has n rows. Each row in band0 has a child band (band1) containing n rows. When I select a row in band0, I want to close the open band1 (if it exists), and then expand the child band (band1) of the band0 row that I selected.
Track the rows that get expanded and when a new one is expanded, collapse the last one. The Before/AfterRowExpanded/COllapsed events fire when a row's expanded state changes.