RadGrid FilterMenu ToolTip

11 posts, 1 answers
  1. guillaume.lebel
    guillaume.lebel avatar
    60 posts
    Member since:
    Oct 2012

    Posted 16 Mar 2009 Link to this post

    Hi,

    Is it possible to change the tooltip on the filtermenu image. I've tried to change it with RadGrid.FilterMenu.Tooltip but it keep saying "Filter".

    I don't know if there's an other way to change it.

    Thank you and have a nice day!

    Guillaume
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Mar 2009 Link to this post

    Hi Guillaume,

    You can try out the following code to set the tooltip of the filter icon to a custom text:
    cs:
      protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
            if (e.Item is GridFilteringItem) 
            { 
                GridFilteringItem filterItem = (GridFilteringItem)e.Item; 
                Button btn = (Button)filterItem["ColumnUniqueName"].Controls[1]; 
                btn.ToolTip = "Custom Text";           
            } 
        } 

    -Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. guillaume.lebel
    guillaume.lebel avatar
    60 posts
    Member since:
    Oct 2012

    Posted 17 Mar 2009 Link to this post

    Thx Princy it worked :)

    Have a nice day!

    Guillaume
  5. Maxime
    Maxime avatar
    12 posts
    Member since:
    Aug 2008

    Posted 05 Jun 2009 Link to this post

    Hi,

    Is there any reason why this button isn't localized by default like the other control in the grid. This resemble to the pager item in another thread. Again, it makes no sense to me why isn't this *easier* to localize aside than by doing tricks in the code behind.

    I don't mean to be rude, I just don't understand why theses items seems to be *omitted*.
  6. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 11 Jun 2009 Link to this post

    Hello Maxime,

    You can set the filter image tooltip in the RadGrid declaration if this is suitable for your scenario:
    <telerik:GridBoundColumn DataField="ID" UniqueName="ID" HeaderText="[ID]" FilterImageToolTip="Test" /> 

    Regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 01 Jul 2009 Link to this post

    Yet again absolutely unacceptable localization solutions.

    Telerik really need to stop for a minute and think about the current localization plan, or the lack of one.
    In my opinion we should have resx files for all controls, or at least some global properties that work throughout any given application.

    The grid is a perfect example of localization madness. Most strings you can translate globally, but then there are various strings you have to translate elsewhere.

    What does this do, or what is it supposed to do?
    grid.FilterMenu.ToolTip = "XXX"

    Personally I'm now spending way too much time trying to find where and how to localize some of the controls, and growing increasingly frustrated I have to admit.

    The worst part is I feel as if there isn't much interest in this topic.

    Regards,
    -DJ-
  8. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 07 Jul 2009 Link to this post

    Hello Daniel,

    Sorry to hear about your frustration. First, I would like to assure you that our developers are doing their best to improve the RadGrid localization mechanism as much as possible. Second, everyone should be able to localize the most of the strings using explicit localization (even if they don't have a ready-to-use resx file). There are few exceptions like the Page Size drop down in the pager which can't be localized using this approach. The good news are that this option will be implemented for the next service pack of RadControls for ASP.NET AJAX.

    Nevertheless, we will be happy to assist you overcome any troubles you have with the localization. For that purpose we created a code-library example that demonstrates how to use resx files to localize RadGrid.
    Localization files for RadGrid, RadCalendar and RadInput

    Furthermore, for your convenience I modified and reattached this code-library project to help you localize the aforementioned tooltip that bothers you.

    The answer to your second question:
    RadContextMenu inherits from the WebControl class, from which it inherits the ToolTip property. It does nothing because it is not suitable for the RadContextMenu structure (I suppose you know that the FilterMenu is actually a RadContextMenu).
    MSDN: WebControl Class (System.Web.UI.WebControls)

    I will be expecting your feedback concerning additional localization improvements you would suggest that can be integrated in our web grid

    Regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. Chris Badman
    Chris Badman avatar
    1 posts
    Member since:
    Jan 2009

    Posted 25 Aug 2009 Link to this post

    Is there a way to do this for every column on the grid without having to set the FilterImageToolTip property individually on each column in the .aspx, or looping through the columns in the code behind?

    Let me clarify. I don't want the tooltip of  "filter" to show up at all. It gets in the way, and the users would rather it not show up at all. So I've been able to set the above mentioned property to "", and that works. But that's a pain to have to do that for every grid, and every column.

    So I'm not sure if there's something hiding out there that would make this easier for me.
  10. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 28 Aug 2009 Link to this post

    Hello Chris,

    I'm afraid there is no way to disable all filter tooltips at once. You should either remove it manually or use localization as demonstrated in the demo below.

    Best regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. Jean-Francois
    Jean-Francois avatar
    2 posts
    Member since:
    May 2013

    Posted 02 May 2013 Link to this post

    Hi,

    The suggested solution works good... however, I have a class to manage the localization.  I pass by ref my radgrid object and then set all the localization by code because we use a main dictionnary for different projetcs.

    Since this solution uses the item_databound event, I wonder what should I do to implement this according to my logic.

    Here's a brief sample of what I do in this class:

            Public Shared Sub SetRadGridCulture(ByRef rg As RadGrid, ByVal langue As String)
                Try
                    Dim Menu As GridFilterMenu = rg.FilterMenu
                    Dim itemMenu As RadMenuItem
                    Dim itemFilter As GridFilteringItem
                    Dim text As String = ""

                    For Each itemMenu In Menu.Items
                        text = getDescriptionTraduite(itemMenu.Text, langue)
                        If Not text.Equals("") Then
                            itemMenu.Text = text
                        End If

                        text = getDescriptionTraduite(itemMenu.ToolTip, langue)
                        If Not text.Equals("") Then
                            itemMenu.ToolTip = text
                        End If
                    Next

                    For Each dt As GridTableView In rg.MasterTableView.DetailTables
                        dt.CommandItemSettings.RefreshText = ""
                        dt.CommandItemSettings.AddNewRecordText = getDescriptionTraduite("AddNewRecordText", langue)
                    Next

                    rg.SortingSettings.SortedAscToolTip = getDescriptionTraduite("SortedAscToolTip", langue)
                    rg.SortingSettings.SortedDescToolTip = getDescriptionTraduite("SortedDescToolTip", langue)
                    rg.SortingSettings.SortToolTip = getDescriptionTraduite("SortToolTip", langue)
                    rg.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
                    rg.PagerStyle.PagerTextFormat = getDescriptionTraduite("PagerTextFormat", langue)
                    rg.PagerStyle.FirstPageToolTip = getDescriptionTraduite("FirstPageToolTip", langue)
                    rg.PagerStyle.LastPageToolTip = getDescriptionTraduite("LastPageToolTip", langue)
                    rg.PagerStyle.PrevPagesToolTip = getDescriptionTraduite("PrevPagesToolTip", langue)
                    rg.PagerStyle.PrevPageToolTip = getDescriptionTraduite("PrevPageToolTip", langue)
                    rg.PagerStyle.NextPagesToolTip = getDescriptionTraduite("NextPagesToolTip", langue)
                    rg.PagerStyle.NextPageToolTip = getDescriptionTraduite("NextPageToolTip", langue)
                    rg.MasterTableView.NoMasterRecordsText = getDescriptionTraduite("NoMasterRecordsText", langue)
                    rg.MasterTableView.NoDetailRecordsText = getDescriptionTraduite("NoDetailRecordsText", langue)
                    rg.PagerStyle.PageSizeLabelText = getDescriptionTraduite("PageSizeLabelText", langue)
                    rg.MasterTableView.CommandItemSettings.AddNewRecordText = getDescriptionTraduite("AddNewRecordText", langue)
                    rg.MasterTableView.ExpandCollapseColumn.HeaderTooltip = ""
                    rg.MasterTableView.CommandItemSettings.RefreshText = ""
                    rg.HierarchySettings.ExpandTooltip = getDescriptionTraduite("ExpandTooltip", langue)
                    rg.HierarchySettings.CollapseTooltip = getDescriptionTraduite("CollapseTooltip", langue)


    and on and on and on..
  12. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 07 May 2013 Link to this post

    Hello Jean-Francois,

    Of course this approach is not suitable for the ItemDataBound event. You could try the Page_Load event instead.

    Regards,
    Daniel
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017