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

RadGrid FilterMenu ToolTip

10 Answers 415 Views
Grid
This is a migrated thread and some comments may be shown as answers.
guillaume.lebel
Top achievements
Rank 1
Iron
Iron
guillaume.lebel asked on 16 Mar 2009, 02:39 PM
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

10 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 17 Mar 2009, 05:32 AM
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.
0
guillaume.lebel
Top achievements
Rank 1
Iron
Iron
answered on 17 Mar 2009, 12:10 PM
Thx Princy it worked :)

Have a nice day!

Guillaume
0
Maxime
Top achievements
Rank 2
answered on 05 Jun 2009, 02:08 PM
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*.
0
Daniel
Telerik team
answered on 11 Jun 2009, 07:57 AM
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.
0
-DJ-
Top achievements
Rank 1
answered on 01 Jul 2009, 06:01 PM
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-
0
Daniel
Telerik team
answered on 07 Jul 2009, 11:52 AM
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.
0
Chris Badman
Top achievements
Rank 1
answered on 25 Aug 2009, 02:17 PM
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.
0
Daniel
Telerik team
answered on 28 Aug 2009, 08:12 AM
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.
0
Jean-Francois
Top achievements
Rank 1
answered on 02 May 2013, 02:18 PM
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..
0
Daniel
Telerik team
answered on 07 May 2013, 08:52 AM
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.
Tags
Grid
Asked by
guillaume.lebel
Top achievements
Rank 1
Iron
Iron
Answers by
Princy
Top achievements
Rank 2
guillaume.lebel
Top achievements
Rank 1
Iron
Iron
Maxime
Top achievements
Rank 2
Daniel
Telerik team
-DJ-
Top achievements
Rank 1
Chris Badman
Top achievements
Rank 1
Jean-Francois
Top achievements
Rank 1
Share this question
or