EnableRangeFiltering="true" getting Incoorect date values at client-side

6 posts, 0 answers
  1. Abhijit Shetty
    Abhijit Shetty avatar
    36 posts
    Member since:
    May 2010

    Posted 11 Aug 2013 Link to this post

    Hi,
    I have set 
    EnableRangeFiltering="true"
    and fetching filter expression as string on ClientEvents>OnCommand event with code as
    sender.get_masterTableView().get_filterExpressions().toString()


    Output of above is:
    ([CreatedDate] >= '01,Aug,,2013') AND ([CreatedDate] <= '09,Aug,,2013')

    I dont know why that comma(,) appears.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Aug 2013 Link to this post

    Hi Abhijit,

    Can you please try the below simple code and check if the issue exists?The code snippet works fine at my end.Can you provide the full code if this doesn't help.

    ASPX:
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="true">
        <MasterTableView>
            <Columns>        
                <telerik:GridDateTimeColumn DataField="OrderDate" HeaderText="OrderDate" UniqueName="OrderDate"
                   EnableRangeFiltering="true">
                </telerik:GridDateTimeColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnCommand="OnCommand" />
        </ClientSettings>
    </telerik:RadGrid>

    JS:
    <script type="text/javascript">
      function OnCommand(sender) {
       var s = sender.get_masterTableView().get_filterExpressions().toString();
       alert(s);
       }
    </script>

    Thanks,
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Abhijit Shetty
    Abhijit Shetty avatar
    36 posts
    Member since:
    May 2010

    Posted 13 Aug 2013 Link to this post

    Hi Princy,
    Thanks for your quick and valuable reply.

    But I'm doing similar thing but dont know why m getting weird dates when set

    EnableRangeFiltering="true"

    Weird thing is when i set it to falase date gets properly rendered.

    <telerik:radgrid id="rgData" runat="server" autogeneratecolumns="false">
                <mastertableview allowfilteringbycolumn="true">
                <Columns>
                    <telerik:GridDateTimeColumn AllowFiltering="true" UniqueName="CreatedDate" DataField="CreatedDate" HeaderText="Created Date"
                        DataType="System.DateTime" PickerType="DatePicker" EnableRangeFiltering="true">
                    </telerik:GridDateTimeColumn>
                </Columns>
            </mastertableview>
                <clientsettings>
            <ClientEvents OnCommand="GridCommand" />
            </clientsettings>
            </telerik:radgrid>


    function GridCommand(sender, args) {
                var filterExpressions = sender.get_masterTableView().get_filterExpressions().toString();
                alert(filterExpressions);
                args.set_cancel(true);
            }


    I have attached a screenshot on values that i get using alert.(PFA)
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 Aug 2013 Link to this post

    Hi Abhijit

    Unfortunately i couldn't replicate the issue.The code is working fine at my side.My version is 2013.2.611.40 .Please find the attached screen shot and here is my complete code.

    ASPX:
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" >
              <MasterTableView AllowFilteringByColumn="true">
                  <Columns>
                      <telerik:GridDateTimeColumn AllowFiltering="true" UniqueName="OrderDate" DataField="OrderDate"
                          HeaderText="OrderDate" DataType="System.DateTime" PickerType="DatePicker" EnableRangeFiltering="true">
                      </telerik:GridDateTimeColumn>
                  </Columns>
              </MasterTableView>
              <ClientSettings>
                  <ClientEvents OnCommand="GridCommand" />
              </ClientSettings>
          </telerik:RadGrid>

    JS:
    <script type="text/javascript">
        function GridCommand(sender, args) {
            var filterExpressions = sender.get_masterTableView().get_filterExpressions();
            alert(filterExpressions);
        }
    </script>

    Thanks,
    Princy
  6. Jannis
    Jannis avatar
    9 posts
    Member since:
    May 2013

    Posted 24 Sep 2015 Link to this post

    Hi,

     

    have the same issue with recent version 2015.2.826.40

    Seems to be culture depending. ​Example here with german culture settings.

    If i set EnableRangeFiltering="false" then i get the correct format

    dd.MM.yyyy HH.mm.ss

    If i set EnableRangeFiltering="true" i get 

    dd.MM.yyyy,HH.mm.ss

    Any fix for this?

     

    Best regards

    Jannis

  7. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 29 Sep 2015 Link to this post

    Hi Jannis,

    I've created a sample RadGrid web site to test the range filtering with german culture and it works correctly on my side. Please run the attached application and let me know about the result on your side.

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017