How to localize DateTimePicker's ToolTip in Filter Menu

8 posts, 1 answers
  1. Motohiro Isozaki
    Motohiro Isozaki avatar
    4 posts
    Member since:
    Feb 2009

    Posted 18 Feb 2009 Link to this post

    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.

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

    Posted 18 Feb 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Motohiro Isozaki
    Motohiro Isozaki avatar
    4 posts
    Member since:
    Feb 2009

    Posted 20 Feb 2009 Link to this post

    It works well!
    Many many thanks!!

  5. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Feb 2009 Link to this post

     



  6. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 01 Jul 2009 Link to this post

    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-
  7. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 02 Jul 2009 Link to this post

    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.
  8. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 02 Jul 2009 Link to this post

    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-
  9. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 07 Jul 2009 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017