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

How to localize DateTimePicker's ToolTip in Filter Menu

7 Answers 245 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Motohiro Isozaki
Top achievements
Rank 2
Motohiro Isozaki asked on 18 Feb 2009, 05:13 PM
Hi,
Could anyone tell me how i can localize and translate
the DateTimePicker's ToolTip in Filter Menu to my own Language?

protected void Page_Load(object sender, EventArgs e) 
    var grid = RadGrid1
    foreach (GridColumn column in grid.Columns) 
    { 
        if (column is GridDateTimeColumn) 
        { 
            var editor = (column as GridDateTimeColumn).CurrentColumnEditor as GridDateTimeColumnEditor; 
            var picker = editor.PickerControl as RadDateTimePicker; 
 
            picker.DatePopupButton.ToolTip = "XXXX"; // why no effect??? 
        } 
    } 
 

Thanks in advance.
Kind Regards.

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Feb 2009, 05:12 AM
Hello Motohiro,

I'm not sure, if you want to customise the tooltip DatePopUpButton of the date picker in the filter row or during EditMode of the grid.
aspx:
 <telerik:GridDateTimeColumn HeaderText="Order Date" UniqueName="OrderDate" DataField="OrderDate">            
 </telerik:GridDateTimeColumn> 

If you want to localize the ToolTip for the RadDatePicker.DatePopUpButton in the Filter Row, check out the following code:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    {        
       if (e.Item is GridFilteringItem) 
        { 
            GridFilteringItem filter = (GridFilteringItem)e.Item; 
            RadDatePicker picker = (RadDatePicker)filter["OrderDate"].Controls[0]; 
            picker.DatePopupButton.ToolTip = "XXXX"
        } 
     } 

If you want to localize the ToolTip for the RadDatePicker.DatePopUpButton during EditMode of the grid, check out the following code:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
       if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
        { 
            GridEditableItem editedItem = e.Item as GridEditableItem; 
            GridEditManager editMan = editedItem.EditManager; 
            GridDateTimeColumnEditor editor = (GridDateTimeColumnEditor)(editMan.GetColumnEditor("BookingDate"));  
            RadDatePicker picker = editor.PickerControl; 
            picker.DatePopupButton.ToolTip = "XXXX"
        } 
    } 
 

Thanks
Princy.
0
Motohiro Isozaki
Top achievements
Rank 2
answered on 20 Feb 2009, 08:35 AM
It works well!
Many many thanks!!

0
Accepted
Shinu
Top achievements
Rank 2
answered on 20 Feb 2009, 08:53 AM
 



0
-DJ-
Top achievements
Rank 1
answered on 01 Jul 2009, 05:36 PM
Holy moly!

Is this the only way to translate the datepicker filter button tooltip?
You have to manually find all datecolumns and add the tooltip there?

Regards,
-DJ-
0
Sebastian
Telerik team
answered on 02 Jul 2009, 08:51 AM
Hello -DJ-,

Indeed currently this is the possible means to define tooltips for the datepicker filters which are part of GridDateTimeColumn. Note that you can traverse all GridDateTimeColumns in the grid with the following modified code snippet:

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)    
    {           
       if (e.Item is GridFilteringItem)    
        {    
           GridFilteringItem filter = (GridFilteringItem)e.Item;  
 
           foreach(GridColumn column in e.Item.OwnerTableView.RenderColumns)  
           {  
             if(column is GridDateTimeColumn)  
             {    
              RadDatePicker picker = (RadDatePicker)filter[column.UniqueName].Controls[0];    
              picker.DatePopupButton.ToolTip = "XXXX";  
             }  
           }    
        }    
     }    
 

Kind regards,
Sebastian
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 02 Jul 2009, 04:01 PM
Hi Sebastian,

That does help a bit.

Something like this would be more helpful though:
RadGrid1.FilterMenu.DatePopupButton.ToolTip = "xxx", because it can be applied to all grids within an application from a central localizing function.

I'm growing somewhat fearful of where Telerik is heading in regards to localization. It looks like it's mostly an afterthought once new features have been added, and not really thought of earlier in the process.

This varies a lot between controls though, some are a breeze to localize or don't even need any localization while others are a pain.

It has always been harder to program non-english applications, and probably always will be. The question is how much we can narrow the gap between the two.

Regards,
-DJ-
0
Sebastian
Telerik team
answered on 07 Jul 2009, 11:27 AM
Hello -DJ-,

My colleague Daniel will provide detailed reply in the other forum thread you participated in which discusses the same subject. You can review his answer in it:

http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-filtermenu-tooltip.aspx

Kind regards,
Sebastian
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.
Tags
Grid
Asked by
Motohiro Isozaki
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Motohiro Isozaki
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
-DJ-
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or