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

Date Between Filter is Not working

3 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 19 Jan 2009, 12:04 PM
Hi,

here i face some problem relataed to the date between Filter in RadGrid.

radG:RadGrid ID="dgRequest" runat="server" AllowSorting="True" AllowPaging="true"

 

 

 

EnableAJAX="False" AllowFilteringByColumn="True" ShowGroupPanel="True" ExportSettings-ExportOnlyData="true"

 

 

 

ExportSettings-IgnorePaging="true" ExportSettings-OpenInNewWindow="true" ShowFooter="false"

 

 

 

Skin="Monochrome" BorderStyle="None" MasterTableView-CellPadding="0" MasterTableView-AutoGenerateColumns="false"

 

 

 

Style="width: 100%;" CellPadding="0" EnableAJAXLoadingTemplate="False" Width="100%"

 

 

 

ClientSettings-ApplyStylesOnClient="true" PageSize="19">

 

 

 

 

 

<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="None" GroupLoadMode="Client"

 

EnableColumnsViewState="true" Style="width: 100%;" DataKeyNames="Request_ID">

 

 

<ExpandCollapseColumn Visible="False">

 

<HeaderStyle Width="19px" />

 

</ExpandCollapseColumn>

 

 

<RowIndicatorColumn Visible="False">

 

 

 

<HeaderStyle Width="20px" />

 

 

 

</RowIndicatorColumn>

 

 

 

<Columns>

 

 

    <radG:GridBoundColumn Visible="False" DataField="Request_ID" HeaderText="RequestID">

 

     

</radG:GridBoundColumn>

 

 

 

<radG:GridButtonColumn Visible="false" HeaderText="select">

 

 

 

</radG:GridButtonColumn>

 

 

 

<radG:GridBoundColumn DataField="date_modified" DataType="System.DateTime" SortExpression="date_modified"

 

 

 

HeaderText="Date Created" AllowFiltering="true" ItemStyle-HorizontalAlign="Right">

 

 

 

</radG:GridBoundColumn>

 

 

 

<radG:GridBoundColumn DataField="vendor_co_name" SortExpression="vendor_co_name"

 

 

 

HeaderText="Vendor Company" AllowFiltering="true">

 

 

 

</radG:GridBoundColumn>

 

 

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

<ClientSettings EnableClientKeyValues="True" ReorderColumnsOnClient="True" AllowColumnsReorder="True"

 

 

 

AllowGroupExpandCollapse="True" AllowDragToGroup="True">

 

 

 

<Resizing AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False" />

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

<Scrolling AllowScroll="False" UseStaticHeaders="False" SaveScrollPosition="True"></Scrolling>

 

 

 

<ClientEvents OnRowDblClick="RowDblClick" OnRowSelected="RowSelected" />

 

 

 

</ClientSettings>

 

 

 

<PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle

 

 

</radG:RadGrid>

 

And in the Code File 

Dim

ds As DataSet

 

 'function that bring the Data and fill the dataset

 

ds = Company.GetVendorRequests(Ds_Security.GetUserID, VendorCoName, vendorUserName, ReqClientCompany, reqStatus, quickSearch)

 

Me.dgRequest.DataSource = ds
ViewState("VendorUsers") = ds

 

 

 

 

 

 

 

And 

Protected

Sub dgRequest_NeedDataSource(ByVal source As Object, ByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles dgRequest.NeedDataSource

 

 

  

 

 

If IsPostBack Then

 

dgRequest.DataSource = ViewState("VendorUsers")
End If

 

 

 

End Sub

 

 

 

 

 


when i filter the data with the Search Criteria

12/18/2008 5/18/2009
it Filter the Result but while i entered the Search Criteria
12/18/2008 11/18/2009 or 12/18/2008 10/18/2009 or 12/18/2008 1/18/2009 it will not showing any reults it such strange.

please give me the solution.

Thanks and Regards
Manoj

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Jan 2009, 04:45 PM
Hello Manoj,

I tried to reproduce the depicted behavior but unfortunately without avail. Please find my test project (based on your code) attached to this post.

Let me know whether it's working as expected.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Manoj
Top achievements
Rank 1
answered on 20 Jan 2009, 08:29 AM

 

 

 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestDate.aspx.vb" Inherits="TestDate" %> 
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %> 
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %> 
<%@ Register TagPrefix="radw" Namespace="Telerik.WebControls" Assembly="RadWindow.Net2" %> 
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %> 
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
        <div> 
            <radG:RadGrid ID="dgRequest" runat="server" AllowSorting="True" AllowPaging="true" 
                GroupPanel-Text="Drag and Drop Column Header To Regroup Column. " EnableAJAX="False" 
                AllowFilteringByColumn="True" ShowGroupPanel="True" ExportSettings-ExportOnlyData="true" 
                ExportSettings-IgnorePaging="true" ExportSettings-OpenInNewWindow="true" ShowFooter="false" 
                Skin="Monochrome" BorderStyle="None" MasterTableView-CellPadding="0" MasterTableView-AutoGenerateColumns="false" 
                CellPadding="0" EnableAJAXLoadingTemplate="False" GridLines="both" ClientSettings-ApplyStylesOnClient="true" 
                Width="100%">  
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="userid" CommandItemDisplay="None" 
                    GroupLoadMode="Client" EnableColumnsViewState="true" TableLayout="Fixed">  
                    <ExpandCollapseColumn Visible="False">  
                        <HeaderStyle Width="19px" /> 
                    </ExpandCollapseColumn> 
                    <RowIndicatorColumn Visible="False">  
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                    <Columns> 
                        <radG:GridBoundColumn DataField="Company_name" SortExpression="Company_name" HeaderText="Company Legal Name" 
                            UniqueName="Company_name">  
                        </radG:GridBoundColumn> 
                        <radG:GridBoundColumn DataField="CreatedDate" SortExpression="CreatedDate" DataType="System.DateTime" 
                            HeaderText="CreatedDate" UniqueName="CreatedDate">  
                        </radG:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
                <ClientSettings EnableClientKeyValues="True" ReorderColumnsOnClient="True" AllowColumnsReorder="True" 
                    AllowGroupExpandCollapse="True" AllowDragToGroup="True">  
                    <Resizing AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False" /> 
                    <Selecting AllowRowSelect="true" /> 
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight="405px">  
                    </Scrolling> 
                </ClientSettings> 
                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle> 
            </radG:RadGrid> 
        </div> 
    </form> 
</body> 
</html> 
 

 


.Vb file Code

Partial Class TestDate  
    Inherits System.Web.UI.Page  
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
 
    End Sub 
 
    Protected Sub dgRequest_NeedDataSource(ByVal source As ObjectByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles dgRequest.NeedDataSource  
        dgRequest.DataSource = TestDateData()  
    End Sub 
 
    Private Function TestDateData()  
        Dim myTable As New DataTable  
        myTable.Columns.Add("userid")  
        myTable.Columns.Add("Company_name")  
        myTable.Columns.Add("CreatedDate")  
        Dim i As Integer 
        Dim dtStr As String 
        For i = 2008 To 2028  
            Dim row As DataRow  
            row = myTable.NewRow()  
            row("userid") = Guid.NewGuid().ToString()  
            dtStr = Convert.ToString("11/12/" + i.ToString())  
            row("Company_name") = "Company" 
            row("CreatedDate") = dtStr  
            myTable.Rows.Add(row)  
        Next 
        Return myTable  
    End Function 
End Class 
 
Hello Daniel,
Plz run the Code and in the Createddate column plz  Fill the 
11/12/2008 01/12/2010 or 11/12/2008 11/12/2010
now Select the between Filter now you can see the between filter is not working in the schenerio.

Thanks and Regards
Manoj


0
Daniel
Telerik team
answered on 22 Jan 2009, 04:54 PM
Hello Manoj,

Thank you for the provided example.

Please test the following modification and let me know whether this helps.
myTable.Columns.Add("CreatedDate"GetType(DateTime)) 

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Manoj
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Manoj
Top achievements
Rank 1
Share this question
or