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

auto filtering in datetime column

7 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
saravanan k
Top achievements
Rank 1
saravanan k asked on 09 Apr 2010, 06:52 AM
Hi,

    i have a datetimecolumn in grid. and my data from the database has values with time also. so when i give the equal to option after selecting a date, it looks for exact match and says no records. is it possible to match only the date string with the input and display all the records for that date. Please help.

Regards,
Saravanan K

7 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 13 Apr 2010, 11:57 AM
Hello saravanan,

The best way is to convert the date values coming from the database to a datetime representation which has 12:00:00 AM as the default time. In this way, you will be able to filter correctly on the date-time column in the grid.

Attached is a small sample. Hope it helps.

Regards,
Tsvetoslav
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
saravanan k
Top achievements
Rank 1
answered on 21 Apr 2010, 07:15 AM
Hi Tsvetoslav,

    Thanks for the reply. 

    But this solution doesn't solves my problem exactly. I need to show the date with time as well as such from the db. I just want to modify the checking logic while using the filter. If there is no way to implement the requirement using auto filters, Kindly throw some light on custom filtering for datetimecolumn also. i am new to telerik controls.

Regards,
Saravanan K
0
Tsvetoslav
Telerik team
answered on 26 Apr 2010, 02:44 PM
Hello saravanan,

Attached is a sample that demonstrates how to modify the filtering condition when you have chose the EqualTo function. If you need any of the other filter functions to work in a similar way just following the logic in the attached test project.

Hope it helps.

Greetings,
Tsvetoslav
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
saravanan k
Top achievements
Rank 1
answered on 07 Jun 2010, 11:27 AM
Hi,
       
          That demo was really helpful. I am almost done. Now i have one more problem. The data in the database is stored in UTC time format, butbefore displaying, in the item data bound event handler i am converting the time information to user's time zone (ex) EST.
So before applying the Linq expression i want to convert the it.HireDate dataitem to EST time zone. I tried appending the TimeZoneInfo.ConvertFromUtc() method inside the string. But exception is thrown saying it is not recogonized as a property or method of the entity object in the datasource.

Please help me with the right Linq expression for this case.

Regards,
Saravanan K
0
Accepted
Tsvetoslav
Telerik team
answered on 09 Jun 2010, 04:20 PM
Hello saravanan,

You can do just the opposite - conver the filter value to UTC format - that way you won't need to apply the conversion to the database values.

All the best,
Tsvetoslav
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
Yogesh Vardhmane
Top achievements
Rank 1
answered on 29 Jul 2010, 11:21 AM
Hello , I am using datetimecolumn in radgrid. I want to fire filter event on dateselect of datepicker. I have set auto post back property for datepicker to true. Still it is not working.
0
Tsvetoslav
Telerik team
answered on 29 Jul 2010, 04:29 PM
Hi Yogesh,

Try upgrading to the latest build of the controls - there was an issue recenlty addressed and you can find the fix in the new dlls.

Hope it helps.

Best wishes,
Tsvetoslav
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
Tags
Grid
Asked by
saravanan k
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
saravanan k
Top achievements
Rank 1
Yogesh Vardhmane
Top achievements
Rank 1
Share this question
or