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

Filtering Time and DateTime issue

6 Answers 261 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vik
Top achievements
Rank 1
Vik asked on 07 Aug 2008, 05:14 PM
Hi all,

I have a grid and three datetime columns within it.
<telerik:GridDateTimeColumn PickerType="DatePicker" DataType="System.DateTime" ...        
<telerik:GridDateTimeColumn PickerType="DateTimePicker" DataType="System.DateTime" ...
<telerik:GridDateTimeColumn PickerType="TimePicker" DataType="System.DateTime" ...

Filtering by using DatePicker works fine.
When I try to filter by second column where I get to choose date and time (from DateTimePicker) and by 3rd column I get to choose time (from TimePicker) I get following error:

The string was not recognized as a valid DateTime.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: The string was not recognized as a valid DateTime.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[FormatException: The string was not recognized as a valid DateTime.]
Telerik.Web.UI.RadDatePicker.set_DbSelectedDate(Object value) +607
Telerik.Web.UI.GridDateTimeColumnHelper.SetDataInputControlValue(Control control, GridDateTimeColumnPickerType pickerType, String value) +51
Telerik.Web.UI.GridDateTimeColumn.SetCurrentFilterValueToControl(TableCell cell) +103
Telerik.Web.UI.GridColumn.SetCurrentFilterValueToControlInternal(TableCell cell) +31
Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +7375
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746


Any ideas?

Another question: Is it possible to set up grid not to display or localize javascript alert "No filter value!" when filter value is empty?

Thanks a lot for the answers.
Vik


6 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 12 Aug 2008, 05:52 AM
Hello Vik,

I tested the behavior that you mentioned, and the control behaved as expected. Attached to this message, is the code, which I used for testing. Take a look at it and let me know if this is the expected behavior, or I am leaving something out.
Additionally, at present there is no option to remove/customize the alert which you mentioned. I will pass this as a feature suggestion to our dev team.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Vik
Top achievements
Rank 1
answered on 12 Aug 2008, 08:39 AM
Hi Yavor,

Thanks for the reply.
I tried your example. When I change PickerType="DateTimePicker" for column "HireDate" I get error I have descibed in my first post.

Can you please check that?
Thanks

Vik
0
Yavor
Telerik team
answered on 12 Aug 2008, 12:04 PM
Hello Vik,

This appears to be a problem in the control, when the given setup is present.
I have alerted our developers, and they will soon investigate the issue in greater detail. I will update this thread with info as needed.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
andy
Top achievements
Rank 1
answered on 23 Aug 2008, 12:20 PM
Hi,

Is there a way to access and localize the Resizing Tooltip?
"Width = {0} pxs"


Thanks,
Rgds,

0
Rosen
Telerik team
answered on 25 Aug 2008, 08:13 AM

Hello andy,

Unfortunatly this is not supported out of the box but you can easly accomplish the desired behavior by hooking to RadGrid's OnColumnResizing client event, then get the resized column's resizer object and change it tooltip text, similar to this:

function onColumnResizing(sender,args)  
{  
    var resizerToolTip = args.get_gridColumn()._columnResizer._resizerToolTip;  
         resizerToolTip.innerHTML = resizerToolTip.innerHTML.replace("Width:","test");    

Kind regards,

Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
andy
Top achievements
Rank 1
answered on 25 Aug 2008, 03:19 PM

Hi,

Appreciate the prompt assistance. It works wonderfully. Unfortunately, i have a problem with clientside because i want need to access resources file for supporting multilanguage, so i just replace width: and pixels with blank, leaving only the numbers which is international :)

Secondly, the onColumnResizing event is only triggered when u start dragging the column border, when u click on it and doesnt drag, it wont replace the innerHtml. Was wondering is there an event similar to OnColumnClick-Ready-For-Resize.

Nevertheless, Thanks.

Rgds

Tags
Grid
Asked by
Vik
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Vik
Top achievements
Rank 1
andy
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or