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

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

1 Answer 26 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sairam
Top achievements
Rank 1
Sairam asked on 17 May 2013, 09:47 AM
<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".

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 22 May 2013, 08:43 AM
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.
Tags
General Discussions
Asked by
Sairam
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or