Back
I recently created a Telerik RadGrid (which is an AWESOME control, by the way) that listed all the states in the USA. The list is big, especially when we list all the territories in the USA, like Puerto Rico, American Samoa, etc. I wanted to filter my results.
![]() |
|
Figure 1: No filters applied. With all the states returned, it can be frustrating to find the state or territory you are interested in. |
![]() |
|
Figure 2: Filter Applied. “Neb” does return “Nebraska” which is great—but this is case-sensitive. |
![]() |
|
Figure 3: Filter Applied. “neb” does not return any states because it is case-sensitive. |
In your markup for your grid you can put the following line:
<telerik:RadGrid ID="StateAdjustmentGrid" runat="server"
AutoGenerateColumns="False" GridLines="None" Skin="Office2007"
AllowFilteringByColumn="False" AllowPaging="True" AllowSorting="True"
PageSize="20" Width="500px"
onneeddatasource="StateAdjustmentGrid_NeedDataSource"
oninsertcommand="StateAdjustmentGrid_InsertCommand"
onitemcommand="StateAdjustmentGrid_ItemCommand"
onitemcreated="StateAdjustmentGrid_ItemCreated"
>
<GroupingSettings CaseSensitive="false" />
The important line is the GroupingSettings line (the other code can be ignored as it was just shown to give you context).
I prefer this method because it doesn’t require a recompile and it “fits” better with the rest of your markup. That is, when I want to see all the settings and formatting requirements I like to look at the markup first. The settings applied in the code-behind are more sinister and hidden.
![]() |
|
Figure 4: Filter Applied. “neb” does return “Nebraska” because it doesn’t care about your case. SUCCESS! |
Last modified about 9 months ago.
|
34 |
![]() Light Snow, 34 |
| 34 | ||
| 33 |