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

Radgrid filter position

1 Answer 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
james
Top achievements
Rank 1
james asked on 24 Jul 2015, 06:06 PM

Hi,

 

Is there a way to position the datepickers vertically on a date range filter column? Because of the number of columns, users are forced resize the datetime column to access the second datepicker in a range fileter.

 

 

James

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 27 Jul 2015, 11:39 AM
Hi James,

For placing the second RadDatePicker on a new line when range filtering is enabled you can handle the server-side OnPreRender event of the grid and use the following code:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    GridFilteringItem filteringItem = RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
    foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns)
    {
        if (column is GridDateTimeColumn && (column as GridDateTimeColumn).EnableRangeFiltering)
        {
            LiteralControl literal = filteringItem[column.UniqueName].Controls[0] as LiteralControl;
            literal.Text = "<span style='display:inline-block; width: 40px;'>" + literal.Text + "</span>";
 
            literal = filteringItem[column.UniqueName].Controls[3] as LiteralControl;
            literal.Text = "<br /><span style='display:inline-block; width: 40px;'>" + literal.Text + "</span>";
        }
    }
}

Hope this helps.


Regards,
Konstantin Dikov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
james
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or