Rad Date picker click odd number,even number click I want chage to Different years and months.

2 posts, 0 answers
  1. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 17 May 2013 Link to this post

    <telerik:GridTemplateColumn HeaderText="End Date" HeaderStyle-ForeColor="Black" ColumnEditorID="GridTextBoxColumnEditor6"
                        AllowFiltering="true" AutoPostBackOnFilter="true" HeaderStyle-Width="138px" DataField="EndDate"
                        CurrentFilterFunction="Contains" DataType="System.DateTime">
                        <ItemTemplate>
                            <%#Eval("EndDate")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadDatePicker ID="radDpEDate" runat="server" MinDate="1/1/1900" MaxDate="12/31/9999" />
                            <asp:RequiredFieldValidator ID="reqDpEndDate" runat="server" ErrorMessage="End Date Required"
                                CssClass="ErrorInSFSE" ControlToValidate="radDpEDate" ValidationGroup="g"> </asp:RequiredFieldValidator>
                            <asp:CompareValidator ID="cmpSdandEd" runat="server" ControlToCompare="radDpSDate"
                                ControlToValidate="radDpEDate" Type="Date" Operator="GreaterThanEqual" ErrorMessage="End Date is GreaterThanEqual start Date"
                                CssClass="ErrorInSFSE" ValidationGroup="g"> </asp:CompareValidator>
                            <asp:Label ID="lblEdate" runat="server" Text=' <%#Eval("EndDate")%>' Visible="false"></asp:Label>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>


    .aspx.cs


    in item_bound()
    {
     if (e.Item.OwnerTableView.IsItemInserted)
                    {
                        Label lblServiceID = (Label)e.Item.FindControl("lblServiceID1");
                        Label lblFedTaxId = (Label)e.Item.FindControl("lblFedTaxID1");
                        lblServiceID.Parent.Parent.Visible = false;
                        lblFedTaxId.Parent.Parent.Visible = false;
                        RadDatePicker radDpEnd = (RadDatePicker)e.Item.FindControl("radDpEDate");
                        radDpEnd.SelectedDate =Convert.ToDateTime("12/31/9999");

                    }
    }
    I am want like this .when  first time page load default "select date"  is "12/31/9999"  ,but we give chance to user, change the  date when he click on date picker I want give present date  calender not "12/31/9999" calender.
    when again user clicks i want, takes the user to "12/31/999" .
    1. In odd no.of clicks , i am display the current date and year "05/17/2013".
    2.In even no.of click ,I am display default calender  "12/31/9999".
  2. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 22 May 2013 Link to this post

    Hi Sairam,

    I am not sure I completely understand your scenario. Are you trying to change the date when the date input is clicked. If that is your scenario I would suggest you to achieve that on client side. I prepared a small sample and attached it to this forum post. Basically you add button click function and on click you change the selected value.

    Regards,
    Kostadin
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top