Format Datetime, Focus Field, Create ShorCutKey for "Apply Filter" button

3 posts, 0 answers
  1. Le Danh
    Le Danh avatar
    12 posts
    Member since:
    Oct 2010

    Posted 29 Nov 2010 Link to this post

    Now, I can't format "LastModifiedAt" column of RadFilter like as "dd/MM/yyyy hh:mm tt". I don't want to set Culture="tr-TR" Page.
    Does other way  implement this format?
    How to set this field focus?
    How to asign ShorCutKey for "OnApplyExpressions" event?

    My coding is below:
        <telerik:RadFilter ID="RadFilter1" runat="server"  OnApplyExpressions="radFilterGridControl_SearchGridData">
                <telerik:RadFilterDateFieldEditor FieldName="LastModifiedAt" DisplayName="LastModifiedAt" DataType="System.DateTime" />
        <telerik:RadGrid ID="radGridControl" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
            <MasterTableView AutoGenerateColumns="False"  >

                    <telerik:GridBoundColumn DataType="System.DateTime" DataField="LastModifiedAt" HeaderText="LastModifiedAt" >

    Can you help me this problem?

    Mr PhuongLD
  2. Daniel
    Daniel avatar
    4949 posts

    Posted 03 Dec 2010 Link to this post

    Hello Mr PhuongLD,

    Please try the following approach:
    public IEnumerable<T> ControlsOfType<T>(Control parent) where T : class
        foreach (Control control in parent.Controls)
            if (control is T)
                yield return control as T;
            foreach (T descendant in ControlsOfType<T>(control))
                yield return descendant;
    protected void RadFilter1_PreRender(object sender, EventArgs e)
        foreach (var picker in ControlsOfType<RadDateTimePicker>(sender as Control))
            picker.DateInput.DateFormat = "dd/MM/yyyy";
            picker.DateInput.DisplayDateFormat = "dd/MM/yyyy";

    Let me know whether this helps.

    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Le Danh
    Le Danh avatar
    12 posts
    Member since:
    Oct 2010

    Posted 29 Dec 2010 Link to this post

    Thank you very much! This error is fixed.
Back to Top