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

Set dynamic width for Rad filter

5 Answers 79 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Priya B
Top achievements
Rank 1
Priya B asked on 25 May 2010, 12:39 PM
Hi

The RAD-filter always have the same width.  See screenshot for example.

Is it possible to make the filter to always get the same width as the column?


Thanks

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 27 May 2010, 03:22 PM
Hello Priya,

Check out the following help document which elaborates on how to change the appearance of the items in the filtering item:
Setting filter textbox dimensions/changing default filter image

Kind regards,
Pavlina
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Priya B
Top achievements
Rank 1
answered on 28 May 2010, 06:20 AM
Hi Pavlina,

Thanks for the link. I have looked on the link already. 

Here we are assigning the width directly. I need to set the Rad filter as same as the Grid column width.

We dint define any width at design time for grid. Hence I  need to get the grid column width at run time and assign to the corresponding Rad filter filter.

Could I have any solution for this?
0
Pavlina
Telerik team
answered on 31 May 2010, 04:54 PM
Hello Priya,

You could set the filter textbox width on ItemDataBound / ItemCreated as shown below:
C#
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)   
    {   
        if (e.Item is GridFilteringItem)   
        {   
            GridFilteringItem filterItem = (GridFilteringItem)e.Item;   
            ((TextBox)filterItem["ColumnUniqueName"].Controls[0]).Width = Unit.Pixel(50);   
        }   
   }    

I hope this helps.

Regards,
Pavlina
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Priya B
Top achievements
Rank 1
answered on 01 Jun 2010, 06:18 AM
Hi Pavlina, 

I need to get the Grid column width and need to assign the same width to Rad Filter textbox.
 
In the below example we are assigning the constant width like '50'. Instead of assigning the value as '50', I need to set the Grid column value.

protected
void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)   
    {   
        if (e.Item is GridFilteringItem)   
        {   
            GridFilteringItem filterItem = (GridFilteringItem)e.Item;   
            ((TextBox)filterItem["ColumnUniqueName"].Controls[0]).Width = Unit.Pixel(50);   
        }   
   }
    
Could you please tell any solutions?

Thanks a lot.
0
Pavlina
Telerik team
answered on 02 Jun 2010, 12:42 PM
Hi Priya,

For more information about how to get the grid column, please refer to the help article below:
http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html

Sincerely yours,
Pavlina
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
Filter
Asked by
Priya B
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Priya B
Top achievements
Rank 1
Share this question
or