Rad Filter displaying default en-US date format, even when en-GB culture is specified.

2 posts, 0 answers
  1. John
    John avatar
    5 posts
    Member since:
    Jul 2011

    Posted 14 Jul 2011 Link to this post

    I've got a radgrid, with a filter setup like so

    myGrid = new RadGrid();
    myGrid.ID = "ClientBoundGrid";
    myGrid.Culture = new System.Globalization.CultureInfo("en-GB");
    //...initialise rest of grid
    myGridRadFilter = new RadFilter
        ID = "myGridFilter",
        FilterContainerID = "ClientBoundGrid",
        Culture = new System.Globalization.CultureInfo("en-GB")
    myGridRadFilter.ApplyExpressions += new EventHandler<RadFilterApplyExpressionsEventArgs>(myGrid_Filter_Apply);

    When I add a filter to the on a date column type, I'd expect the date to be in the format appropriate for the culture I use. (DD/MM/YYYY in this case). However when a date is either typed, or selected from the calender popup, it formats itself to the default en-US format (MM/DD/YYYY). Have I missed a step?

    On a slightly related question, is it possible to modify the radfilter object to remove the calender and/or time popups from appearing?
  2. Daniel
    Daniel avatar
    4949 posts

    Posted 21 Jul 2011 Link to this post

    Hello John,

    The picker controls that are nested in RadFilter won't inherit their culture out-of-the-box.
    I made a simple demo that shows how to set this culture manually. The same project demonstrates also how to hide the unwanted buttons.
    RadFilter1.PreRender += (s, a) =>
        IEnumerable<RadDateTimePicker> pickers = ControlsOfType<RadDateTimePicker>(RadFilter1).
            Where(p => p.SelectedDate == null).Select(p => p);
        foreach (RadDateTimePicker picker in pickers)
            picker.DatePopupButton.Visible = false;
            picker.TimePopupButton.Style.Add("visibility", "hidden"); //do not set Visible false here
            picker.Culture = RadGrid1.Culture;

    Hope this helps.

    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top