This is a migrated thread and some comments may be shown as answers.

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

5 Answers 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abhijit Shetty
Top achievements
Rank 2
Abhijit Shetty asked on 11 Aug 2013, 01:36 PM
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.

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Aug 2013, 07:34 AM
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
0
Abhijit Shetty
Top achievements
Rank 2
answered on 13 Aug 2013, 06:14 PM
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)
0
Princy
Top achievements
Rank 2
answered on 14 Aug 2013, 12:19 PM
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
0
Jannis
Top achievements
Rank 1
answered on 24 Sep 2015, 09:36 AM

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

0
Eyup
Telerik team
answered on 29 Sep 2015, 07:39 AM
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
Tags
Grid
Asked by
Abhijit Shetty
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Abhijit Shetty
Top achievements
Rank 2
Jannis
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or