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

Custom search filter value format validation in RadGridView

3 Answers 146 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chandra Sekhar
Top achievements
Rank 1
Chandra Sekhar asked on 12 Oct 2017, 07:19 PM

Hi,

I have a grid view having search filter button on and need to filter the date column with a custom filter. When I click on the 'Custom' option, the Filter Dialog will get popped up and I can give my search values and click on 'OK', If user gives the date as '31/12/2017' then my application is crashing after it raises a validation error message. I don't know where to catch this exception and act upon. Please help me providing solution for at least one of the below things or any other better way to handle this.

1. Validate the date value as per the format expecting by the application before closing the Filter dialog box.

2. Catch the exception raised by the wrong format/OK button click

3. Restrict the user to not enter the values except in the specified format

 

Thanks in advance.

Chandra

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Oct 2017, 09:02 AM
Hello, Chandra,  

Thank you for writing.  

According to the provided screenshot, it seems that you use an old version of the Telerik UI for WinForms suite. In the latest version, RadDataFilter is integrated into the custom filter popup. Feel free to upgrade in order to benefit from all the introduced new improvements. I am not sure what is the exact format for the date time picker, but the entered string may not be converted to DateTime if the format is month/day/year. Thus, 31 is not a valid month. In this case, it would be necessary to enter 12/31/2017. 

If you are still experiencing any further difficulties, feel free to submit a support ticket where you can provide a sample project demonstrating the problem you are facing. Thus, we would be able to assist you further.

I hope this information helps. 

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Chandra Sekhar
Top achievements
Rank 1
answered on 13 Oct 2017, 06:58 PM

Hi Dess,

Thanks for the quick reply. I use the 2017.1.117.40 version of Telerik library for Winforms, I believe this version does have the feature you were mentioning. However I don't want to use it just because of some consistency issues across the project. As explained earlier, I just want to either catch the crash that was happening or the event where I can validate the format of the date before it actually gets converted as DateTime. Can you put up some example with a date filter in a grid and filter it using the above mentioned format. Please make sure the sample to handle the date validation code. I appreciate your time and help.

Thanks,

Chandra.

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Oct 2017, 07:38 AM
Hello, Chandra,  

Thank you for writing.  

When I modified my sample project to use the specified version 2017.1.117.40 and adjust the DateTime format to be "dd/MM/yyyy", everything seems to work as expected on my end. Please refer to the attached gif file. Am I missing something? Could you please specify the exact steps how to reproduce the error you are facing with the provided project?

Alternatively, feel free to submit a support ticket where you can provide a sample project demonstrating the problem you are facing. Thus, Telerik support will gladly assist you.

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Chandra Sekhar
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Chandra Sekhar
Top achievements
Rank 1
Share this question
or