New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Case Sensitive Grouping
RadGrid supports grouping of items based on the value of a particular column. To group these items in a case sensitive order you can set GroupingSettings.CaseSensitive property to true. Using this property you will make the grid grouping and filtering case sensitive.
ASP.NET
<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" ShowGroupPanel="true">
<GroupingSettings CaseSensitive="true" />
<ClientSettings AllowDragToGroup="True" />
</telerik:RadGrid>
If you use case sensitive grouping and the grid is populated through NeedDataSource event or with SqlDataSource you should make the data table CaseSensitive .
When you are populating the grid through NeedDataSource and at the same time you need case sensitive grouping you can use the code snippet below:
C#
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
DataTable table = new DataTable();
table.Columns.Add("ID");
table.Columns.Add("Item");
table.Columns.Add("Date", typeof(DateTime));
for (int i = 1; i < 8; i++)
{
table.Rows.Add(i, "Item", DateTime.Now.AddDays(i));
}
for (int i = 1; i < 8; i++)
{
table.Rows.Add(i, "item", DateTime.Now.AddDays(i));
}
table.CaseSensitive = true;
RadGrid1.DataSource = table;
}
If you are using SqlDataSource you can make the grid grouping case sensitive with the following code:
C#
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
DataView dv = (DataView)sqlDS1.Select(DataSourceSelectArguments.Empty);
DataTable dt = new DataTable();
dt = dv.ToTable();
dt.CaseSensitive = true;
RadGrid1.DataSource = table;
}