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

GridDateTimeColumn "Equal To" filter problem

10 Answers 374 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Thirunavukarasu Kannappan
Top achievements
Rank 1
Thirunavukarasu Kannappan asked on 19 Mar 2010, 05:11 PM

Hi,

I am facing problem in GridDateTimeColumn "Equal To " filter problem .I have one webpage having telerik:RadGrid .
In this page grid I am having 

"<telerik:GridDateTimeColumn DataField="DateRefundRequested"

FilterListOptions="VaryByDataType" HeaderText="Date"

UniqueName="DateRefundRequested" HeaderStyle-Width="175px"

AllowFiltering="true"  /> 
Column."

I assigned to datasource to this telerik grid. In this datasource datetime type column value binded to corresponding "telerik:GridDateTimeColumn" in that telerik grid.

When I run this page .the datasource value filled to gird. When I try to filter that grid is “EqualTo”.it was displayed is “No records found.”

But When I apply the filter is “GreaterThan” ,it was return the results.

So can you please suggest how to solve this issue.

This is my code:

<telerik:RadGrid runat="server" ID="ListGrid" ShowStatusBar="True"

                        AllowPaging="True" GridLines="None" Skin="Office2007"

                        PageSize="5" BorderStyle="Solid" AllowFilteringByColumn="True" AllowMultiRowSelection="True"  

                        PagerStyle-AlwaysVisible="true" ShowGroupPanel="True"                                                                

                        OnNeedDataSource="ListGrid_NeedDataSource"    

                        OnItemCommand="ListGrid_ItemCommand"

                        OnItemDataBound="ListGrid_ItemDataBound"   

                        OnItemEvent="ListGrid_ItemEvent"

                        OnPreRender="ListGrid_PreRender"                       

                        Width="100%"

                                               

                        <ClientSettings AllowDragToGroup="false" AllowColumnsReorder="false" ReorderColumnsOnClient="False" >

                            <Scrolling AllowScroll="false" UseStaticHeaders="false" />                                                                          

                        </ClientSettings>        

               

                        <GroupPanel ID="GridViewLeftGroupPanel" Text="Refund Requests">

                            <PanelStyle Width="100%" Height="20px" />

                        </GroupPanel>

                                             

                        <PagerStyle Mode="NextPrevNumericAndAdvanced" />

                        <ItemStyle HorizontalAlign="Left" />

                                                               

                        <mastertableview CommandItemDisplay="Top" AutoGenerateColumns="False" Width="100%"

                            CssClass="DetailTable_Default" DataKeyNames="PaymentRefundRequestID" NoMasterRecordsText="No records found." EditMode="InPlace" >

                                       

                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />

                                       

                            <CommandItemTemplate>

                                <div style="text-align: right; padding-top: 3px; padding-bottom: 3px; text-align: right; width: 100%;" >

                                    <asp:LinkButton runat="server" ID="selectAll" Text="Select All"

                                        CommandName="SelectAll" SkinID="GridSelectAllLinkButton"

                                        meta:resourcekey="selectAllResource1" />

                                    <asp:LinkButton runat="server" ID="unselectAll" Text="Deselect All"

                                        CommandName="UnSelectAll" SkinID="GridUnSelectAllLinkButton" Visible="False"

                                        meta:resourcekey="unselectAllResource1" />

                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    <asp:LinkButton runat="server" ID="denyRefunds" Text="Deny Refund"

                                        OnClientClick="return OpenDenyReasonWindow();"

                                        SkinID="GridDenyRefundLinkButton" meta:resourcekey="denyRefundsResource1" />

                                    <asp:LinkButton runat="server" ID="processRefunds" Text="Process Refund"

                                        CommandName="ProcessRefunds" SkinID="GridProcessRefundLinkButton"

                                        meta:resourcekey="processRefundsResource1" />

                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    <asp:LinkButton ID="refreshPaymentsButton" runat="server" CommandName="Rebind"

                                        Text="Refresh" ToolTip="Refresh" SkinID="GridRefreshLinkButton"

                                        meta:resourcekey="refreshPaymentsButtonResource1" />

                                </div>

                            </CommandItemTemplate>

                           

 

                            <Columns>

                                <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn"

                                    HeaderText="Select" AllowFiltering="false"

                                    meta:resourcekey="GridTemplateColumnResource1">                                  

                                    <ItemTemplate>

                                        <asp:CheckBox id="chbxSelect" OnCheckedChanged="ToggleRowSelection"

                                            AutoPostBack="True" runat="server" meta:resourcekey="chbxSelectResource1"></asp:CheckBox>

                                    </ItemTemplate>

                                </telerik:GridTemplateColumn>

                                <telerik:GridBoundColumn DataField="IsParentPayment" HeaderText="&nbsp;"

                                    HeaderStyle-Width="20px" UniqueName="ParentPayment" AllowFiltering="false"

                                    ReadOnly="true">

                                    <HeaderStyle Width="20px"></HeaderStyle>

                                </telerik:GridBoundColumn>                                                                                              

                                <telerik:GridDateTimeColumn DataField="DateRefundRequested" HeaderText="Date"

                                    UniqueName="DateRefundRequested" HeaderStyle-Width="175px"

                                    AllowFiltering="true" FilterListOptions="VaryByDataType"

                                    meta:resourcekey="GridBoundColumnResource3" />           

                                <telerik:GridBoundColumn DataField="EntPayID" HeaderText=""

                                    DataType="System.Int32" UniqueName="EntPayID" AllowFiltering="False"

                                    Visible="false" meta:resourcekey="GridBoundColumnResource4" />

                                <telerik:GridBoundColumn DataField="RefundReason" DataType="System.String"

                                    HeaderText="Reason" UniqueName="RefundReason" AllowFiltering="true"

                                    FilterListOptions="VaryByDataType"

                                    meta:resourcekey="GridBoundColumnResource11" />                                                               

                            </Columns>     

                           

                        </mastertableview>

                    </telerik:RadGrid>

 

In this code "DateRefundRequested" GridDateTimeColumn column only i am trying to filter.but it is not working.

~ Thirunavukarasu

10 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 24 Mar 2010, 04:02 PM
Hi Thirunavukarasu,

I have prepared a sample project for you demonstrating how to implement filtering for a GridDateTimeColumn.
It is working fine on my side and the NoRecordsTemplate is displayed only when there is no date in the records matching the value of the selected one.
Please take a look at the attachment and let me know whether it helps.

Kind regards,
Mira
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Thirunavukarasu Kannappan
Top achievements
Rank 1
answered on 29 Mar 2010, 09:31 AM

Hi Mira,

Thanks for your reply. I used your same attachment code. But it is not working. I attached screen shots.

 

Regards

Thirunavukarasu K

0
Mira
Telerik team
answered on 01 Apr 2010, 08:21 AM
Hello Thirunavukarasu,

As you can see from the sample project attached in my previous message, I am unable to replicate the described issue.

If the problem persists, please open a formal support ticket and attach a sample runnable project demonstrating it. We will debug it locally and get back to you with our findings.

All the best,
Mira
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Huib
Top achievements
Rank 1
answered on 26 Jul 2010, 10:37 AM
I ran into the same problem, I found out that EqualTo only works if you have a DateTime without the timespan (time set to zero), If a time is set to the OrderDate for example, its always bigger than the time selected in the filter
0
Iana Tsolova
Telerik team
answered on 29 Jul 2010, 11:49 AM
Hello Huib,

In order to achieve your goal, you can handle the grid FilteringCommand as in the below articles and override the grid filter expression:

http://www.telerik.com/help/aspnet-ajax/grdoperatewithfilterexpression.html
http://www.telerik.com/help/aspnet-ajax/grdfilteringfordatetimecolumnwithdataformatstring.html

Another option is to define your own FilterTemplate. You can check out this online demo for more information.

Regards,
Iana
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Manishkumar
Top achievements
Rank 1
answered on 06 Sep 2011, 11:13 AM
hi;
I am also runniing with the same issue .My filtering is not working incase of DateBound Column.I have tried to run the sample Project as well but that to was not working .
Please find more details in the following link
http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/radgrid-filter-not-working-for-griddatetimecolumn-for-equal-to-options.aspx
0
Manishkumar
Top achievements
Rank 1
answered on 08 Sep 2011, 08:22 AM
Hi;
Can We have Any Resolution for above issue.We have tried all the thing but nothing seems to be Working for us.
We are having Go-Live very soon please provide some reosultion
0
Mira
Telerik team
answered on 08 Sep 2011, 11:32 AM
Hello Manishkumar,

What do you mean by "I have tried to run the sample Project as well but that to was not working ." ?
If you provide us a detailed explanation of the issue and steps to replicate it, we will do our best to resolve it.

Opening a formal support ticket and sending us a runnable project will be highly appreciated.

Kind regards,
Mira
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Manishkumar
Top achievements
Rank 1
answered on 08 Sep 2011, 02:48 PM
hi Mira
the sample Project attach in this forum thread. I have tried that project but still it was not working.
Can u please show me some work around to achive this.
please tell how can i upload sample project in this forum thread
0
Mira
Telerik team
answered on 13 Sep 2011, 02:06 PM
Hello Manishkumar,

Please open a formal support ticket through your account and attach the project to it.
We will debug it locally and get back to you with our findings.

Thank you in advance for the cooperation.

Greetings,
Mira
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Filter
Asked by
Thirunavukarasu Kannappan
Top achievements
Rank 1
Answers by
Mira
Telerik team
Thirunavukarasu Kannappan
Top achievements
Rank 1
Huib
Top achievements
Rank 1
Iana Tsolova
Telerik team
Manishkumar
Top achievements
Rank 1
Share this question
or