How do I hide the indicator (+/-) on the band row when there are no child rows?
Using the Ultra Grid designer or in code you have to set the override expansion indicator property of the band in question:
Band.Override.ExpansionIndicator = ShowExpansionIndicator.CheckOnDisplay
Note that in order to determine whether a parent row has child rows, the grid has to ask the BindingManager to retrieve the child rows collection. This could cause some performance issues, depending on the data source (which is why the grid does not do this by default).
Mike Saltzman said: Note that in order to determine whether a parent row has child rows, the grid has to ask the BindingManager to retrieve the child rows collection. This could cause some performance issues, depending on the data source (which is why the grid does not do this by default).
Thanks for the heads-up!
In my particular scenario though, the child collection will only contain a couple of rows at most.
The number of child rows is not really the deciding factor here. It's how efficient the data source is at retrieving those rows.
If you use UltraDataSource or a BindingList<T>, it will be fine.
But if you are using a DataSet, the DataSet will loop through every row in the child table every time you try to get the child rows for any particular parent row.
Hi,
I found the solution to solve my performance issue (clicking 1 row which has no child takes time to get the focus) by setting syncwithcurrencymanager to false.
Thanks.
You seem to be suggesting that the grid is not only asking for the rows but looping over them. If you set ExpansionIndicators to CheckOnExpand or Never, then I can't see any reason why the WinGrid would ever ask for the child rows, nor would it loop over them.
How do you something is looping over the child rows? And how are you determining that it's the grid doing it?
Is there an option to hide the expansion indicator AND prevent the looping?
First click on the row takes time to focus when I have a big dataset and there is no child while the ExpansionIndicator set to Never.
Is there a way to prevent the looping\search for child of a specific row? by event or while initializing the row (when I know there will be no children ) or by any property?
I have definitely felt the pain of binding grids to datasets with more than a few parent/child relations. Not very fun at all.
Mike Saltzman said: The number of child rows is not really the deciding factor here. It's how efficient the data source is at retrieving those rows. If you use UltraDataSource or a BindingList<T>, it will be fine. But if you are using a DataSet, the DataSet will loop through every row in the child table every time you try to get the child rows for any particular parent row.
I see. My child collection happens to be a BindingList<T> :)