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

ControlParameter using RadDatePicker breaks grid

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 27 Oct 2017, 03:34 AM

Hello,

I'm attempting to use a RadDatePicker to feed into a query using a ControlParameter linked to it.  The very of adding it in causes the grid to not render even if I don't use the parameter in the query itself.  If add a default value to the RadDatePicker it seems to work fine so something is going on when it is trying to pass the default value (i assume null) and map it to the parameter.

Example code:

<telerik:RadDatePicker ID="Record_Date" MinDate="1900-01-01" runat="server" CssClass="birtForm" AutoPostBack="True" Width="200px" DataTextField="Record_Date" DataValueField="Record_Date">
</telerik:RadDatePicker>

 

<asp:ControlParameter Name="Record_Date" PropertyName="SelectedDate" ControlID="Record_Date"></asp:ControlParameter>

 

Is there a solution to this?

Thanks

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 01 Nov 2017, 02:10 PM
Hi Chris,

Do you use this SelectedDate ControlParameter in the WHERE clause of the Select command? In this case, it is expected that the DefaultValue should be present. Otherwise, it is just like passing a null and there may be no records returned from the database.

If you aim to implement initial filtering, you can achieve this using the approach demonstrated in the following post:
https://www.telerik.com/forums/radgrid-enable-filter-code-behind#cel1slcp-U-pmV28CfXTrg

And here is a sample for the Between function:
https://www.telerik.com/forums/setting-a-filter-in-the-index-changed-event-of-a-drop-down-combo-not-filtering-the-grid#_QnXxSMs5Uq9rddb2JWcWA

I hope this will prove helpful.

Regards,
Eyup
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
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or