Customizing icon toolitp when filtering radgrid

3 posts, 0 answers
  1. Gaetan
    Gaetan avatar
    8 posts
    Member since:
    May 2015

    Posted 25 Nov 2015 Link to this post

    Good morning,

    Is there anyway to change the tooltip of the filter icon of a radgrid column, so that it displays the current filter (i.e. 'contains', 'starts with', ...)?

    thanks a lot,

    Gaetan

  2. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 30 Nov 2015 Link to this post

    Hi Gaetan,

    You can use the following approach to achieve this requirement:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridFilteringItem)
        {
            GridFilteringItem item = e.Item as GridFilteringItem;
            foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns
                .OfType<IGridDataColumn>().Where(x => x.AllowFiltering))
            {
                Button button = item[col.UniqueName].FindControl("Filter_" + col.UniqueName) as Button;
                button.ToolTip = col.CurrentFilterFunction.ToString();
            }
        }
    }

    Hope this helps. Please give it a try and let me know if it works for you.

    Regards,
    Eyup
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Gaetan
    Gaetan avatar
    8 posts
    Member since:
    May 2015

    Posted 30 Nov 2015 in reply to Eyup Link to this post

    Hello Eyup,
    worked like a charm, thanks a lot.
    Gaetan
Back to Top