Set dynamic width for Rad filter

6 posts, 0 answers
  1. Priya B
    Priya B avatar
    21 posts
    Member since:
    Apr 2010

    Posted 25 May 2010 Link to this post

    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
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 27 May 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Priya B
    Priya B avatar
    21 posts
    Member since:
    Apr 2010

    Posted 28 May 2010 Link to this post

    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?
  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 31 May 2010 Link to this post

    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.
  6. Priya B
    Priya B avatar
    21 posts
    Member since:
    Apr 2010

    Posted 01 Jun 2010 Link to this post

    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.
  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 02 Jun 2010 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017