Hi ,
I'm using wingrid 8.2 ver. i have created three groups using SortedColumns.Add method.
Right now it is showing 3 group by rows and its child rows.
Now i want to hide or remove first 2 group by rows not its child rows. Is there any way to do it.
Please let me know.
Thanks
Amit
Hi Amit,
No, you can't hide a parent GroupByRow without hiding it's children.
If you want to group the grid based on the combined values of 3 fields, what you can do is write your own custom SortComparer to sort the data and your own custom GroupByEvaluator to handle the grouping. Then you would simply group on one column and group by all three fields at once.
Hi Mike.
Can you provide me the sample or link so i cam impliment
Correction... "I understand that using the OutlookGropuing we CAN'T mix a standard row witha groupbyrow"
No, there's no reasonable workaround for this. You cannot mix data rows and GroupByRows in the same collection.
If you are looking for an unreasonably workaround, you could try using a CreationFilter to create normal data row elements inside of or in place of the GroupByRow. But this would be an extraordinarily complicated and difficutl task and I would not recommend attempting it.
Thanks for the your reply Mike. I was not too optomistic given the previous replies to this exact same question.
The only other way I know how can create this visual display would be a relationship? I don't think it's possible to relate back to the same data and exclude the top most record.
Can you add a row to an existing row to create a branch of rows?
I know this is out of your scope at this point; but, if anyone who has run across this challenge what they ended up doing (go a different direction, use a different control, etc).
Again, thanks for your help.
Well, if you want to create a sort've manual data source, you could use UltraDataSource. You could group your data in code yourself, then copy it into an UltraDataSource. The problem is that the data structure still has to be homogenous. So all of the rows at the same level of the grid have to have the same columns. You could, of course, leave some of those columns blank for your "GroupBy" rows.
If you don't have a huge amount of data and you don't mind copying the data into another structure, then you might consider using the UltraWinTree instead of the grid. The tree can support non-homogenous data. You would still have to copy the data into some ILists or IBindingLists that you implement yourself, but you could then have a single list of items with different types of parent rows.
The other down side of using the tree is that it doesn't have some of the features of the grid like filtering or summaries.
Follow up:
Using the Ultra(Win)DataSource I was able to create the desired display. I've attached a screenshot of what I wanted to accomplish.
The UltraDataSource examples provided helped me get to this implementation.
Thanks for your suggessions Mike!!!