New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Reduce cell width of RadGrid range filtering

DESCRIPTION

The GridDateTimeColumn of RadGrid provides convenient built-in range filtering functionality:

ASP.NET
<telerik:GridDateTimeColumn DataField="OrderDate" DataType="System.DateTime"
    FilterControlAltText="Filter OrderDate column" HeaderText="OrderDate"
    SortExpression="OrderDate" UniqueName="OrderDate" EnableRangeFiltering="true"
    EnableTimeIndependentFiltering="true">
</telerik:GridDateTimeColumn>

Since this requires 2 picker controls to be generated, the width of the filtering cell may increase beyond its standard size.

SOLUTION

To reduce this cell width, you can put the pickers in two lines:

C#
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridFilteringItem)
    {
        GridFilteringItem filterItem = e.Item as GridFilteringItem;
        (filterItem["OrderDate"].Controls[3] as LiteralControl).Text = "<br />To: ";
    }
}
In this article
DESCRIPTIONSOLUTION
Not finding the help you need?
Contact Support