Telerik
Home / Community / Forums / Grid / How to localize DateTimePicker's ToolTip in Filter Menu

Answered How to localize DateTimePicker's ToolTip in Filter Menu

Feed from this thread
  • Motohiro Isozaki Motohiro Isozaki's avatar

    Posted on Feb 18, 2009 (permalink)

    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.

    Reply

  • Princy MVP Princy's avatar

    Posted on Feb 18, 2009 (permalink)

    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.

    Reply

  • Motohiro Isozaki Motohiro Isozaki's avatar

    Posted on Feb 20, 2009 (permalink)

    It works well!
    Many many thanks!!

    Reply

  • Answer Shinu MVP Shinu's avatar

    Posted on Feb 20, 2009 (permalink)

     



    Reply

  • -DJ- Master -DJ-'s avatar

    Posted on Jul 1, 2009 (permalink)

    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-

    Reply

  • Telerik Admin admin's avatar

    Posted on Jul 2, 2009 (permalink)

    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.

    Reply

  • -DJ- Master -DJ-'s avatar

    Posted on Jul 2, 2009 (permalink)

    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-

    Reply

  • Telerik Admin admin's avatar

    Posted on Jul 7, 2009 (permalink)

    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.

    Reply

Related resourses for "How to localize DateTimePicker's ToolTip in Filter Menu"

ASP.NET Grid Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]

Powered by Sitefinity ASP.NET CMS

Contact Us | Site Feedback | Terms of Use | Privacy Policy
Copyright © 2002-2010 Telerik. All rights reserved.