Is there a way to allow a user to have one grouping be multiple columns?Example: Categories contain questions (all questions have a category). Templates are made of one or more questions, the same question can be used on multiple templates, but one template can only contain a question one time.Dataset:CategoryQuestionTemplate nameTemplate dateThe user might want to group by Category or by Template Name/Template Date. Is there a way a user can make the group be based on both the Template Name column and the Template Date column?
Sam
Hi Sam,
The user can, of course, group by two columns - but then this will create multiple levels of grouping, which is not what you want.
If you want to create a grouping that is based on the value of two columns, you can do that using the GroupByEvaluator property of the column.
The way grouping works is that the column is first sorted. Then the grid goes through the rows in order and uses the GroupByEvaluator to determine if the rows belong in the same group. Normally, it does this by comparing the value in the row to the value of the next row, but you can use the GroupByEvaluator to group by any criteria you like. In this case, you will also need a SortComparer to make sure that sorting the column sorts by both fields so that the grouping will work properly.
Hi Mike,
I also have similar requirement. Can you
please provide a sample for how to use GroupbyEvaluator ?
Thanks,
Abhinav