ControlParameter using RadDatePicker breaks grid

2 posts, 0 answers
  1. Chris
    Chris avatar
    13 posts
    Member since:
    Dec 2011

    Posted 26 Oct 2017 Link to this post

    Hello,

    I'm attempting to use a RadDatePicker to feed into a query using a ControlParameter linked to it.  The very action of adding it in causes the grid to not render even if I don't use the parameter in the query itself.  If i 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

  2. Eyup
    Admin
    Eyup avatar
    3817 posts

    Posted 01 Nov 2017 Link to this post

    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.
Back to Top