I have a grid that has columns such as Job number and Admin Name.
I am grouping the rows by the Job Number. But I only want them to be grouped when there is more than one record. The user wants to see the +sign only when there is more than one admin per Job. is this possible? Can you help me find a solution for this?
4 Answers, 1 is accepted
Thank you for writing.
If I understand your requirement correctly, you are trying to hide the group row element if the group has only 1 record in it. For this purpose, it is suitable to use the ViewRowFormatting event and set the GridGroupHeaderRowElement.RowInfo.Height property to 1. It is important to expand the group in order to display this single record. Here is a sample code snippet:
Note that this is just a sample approach and it may not cover all possible cases. Feel free to modify it in a way which suits your requirement best.
I hope this information helps. Should you have further questions I would be glad to help.
Thank you Dess. It worked like a charm.
I also want the groupby column(in this case, Job number column) to show up in the row as well.
Thank you for writing back.
In order to show the grouped column in the row as well, you should set the RadGridView.MasterTemplate.ShowGroupedColumns property to true.
I hope this information helps. If you have any additional questions, please let me know.