This is a migrated thread and some comments may be shown as answers.

[Solved] Grouping By Substring

1 Answer 137 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 17 Apr 2009, 09:02 PM
I have a column that I'm displaying in the RadGrid which has text in the following format:

"Part1.Part2.Part3.Part4"

The number of parts is variable.

I'd love to be able to group their display in the grid based on everything but the last part in the string. For instance, consider the following values:

MyCompany.MyProduct.MyModule1.MySetting1
MyCompany.MyProduct.MyModule1.MySetting2
MyCompany.MyProduct.MyModule2.MySetting3
MyCompany.MyProduct.MyModule3.MySetting4

My grid would display like:

MyCompany.MyProduct.MyModule1
--> MyCompany.MyProduct.MyModule1.MySetting1
--> MyCompany.MyProduct.MyModule1.MySetting2
MyCompany.MyProduct.MyModule2
--> MyCompany.MyProduct.MyModule2.MySetting3
MyCompany.MyProduct.MyModule3
--> MyCompany.MyProduct.MyModule3.MySetting4

In otherwords, is there a way to create a grouping expression that grouped on a substring of the value of the column?

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 22 Apr 2009, 10:38 AM
Hello Robert,

You can only group on the actual value coming from the database. Another option would be to include a separate field/column, which contains a substring of the original value, and group on it instead.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or