Hi There,
I have a repeater control that outputs two RadDatePickers per row as shown below.
I want to associate a javascript function to the OnDateSelected event for each of the RadDatePickers so that i can work out the number of weeks between the dates and display the value in the "datevalue" label.
I am aware of the standard paramaters that get passed to the javascript function that you assign to the OnDataSelected property, but my problem is from within that function how can I access the other RadDatePicker and also the label.
If I was able to make OnDateSelected take extra paramaters i could pass into it the client id for the other RadDatePicker and the label.
I am looking for any suggested approaches.
Thanks in advance
Jason
I have a repeater control that outputs two RadDatePickers per row as shown below.
<asp:Repeater ID="rep_mediaassetbursts" runat="server" DataSourceID="ods_mediaassetbursts" OnItemDataBound="rep_mediaassetbursts_ItemDataBound"> |
<HeaderTemplate> |
<table> |
<tr> |
<th>Bursts</th> |
<th>Value</th> |
<th>Start Date</th> |
<th>End Date</th> |
</tr> |
</HeaderTemplate> |
<ItemTemplate> |
<tr> |
<td><asp:Label ID="burstNumber" runat="server" Visible='true' ></asp:Label></td> |
<td><telerik:RadNumericTextBox ID="MediaAssetBurstValue" runat="server" DbValue='<%# Bind("investment") %>' MinValue='0' Width="75px" DataType="System.Int32" Type="Currency" ><NumberFormat DecimalDigits="0" /><EnabledStyle HorizontalAlign="Right" /></telerik:RadNumericTextBox></td> |
<td><telerik:RadDatePicker ID="BurstStartDate" runat="server"> |
</telerik:RadDatePicker><asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="BurstStartDate" |
ErrorMessage="Enter a date!" Display="Dynamic"></asp:RequiredFieldValidator></td> |
<td><telerik:RadDatePicker ID="BurstEndDate" runat="server" ></telerik:RadDatePicker><asp:RequiredFieldValidator runat="server" ID="Requiredfieldvalidator2" ControlToValidate="BurstEndDate" |
ErrorMessage="Enter a date!" Display="Dynamic"></asp:RequiredFieldValidator><asp:CompareValidator ID="dateCompareValidator" runat="server" ControlToValidate="BurstEndDate" |
ControlToCompare="BurstStartDate" Operator="GreaterThanEqual" Type="Date" ErrorMessage="The second date must be after the first one." Display="Dynamic"></asp:CompareValidator> |
<asp:Label runat="server" ID="datevalue"></asp:Label> |
</td> |
</tr> |
</ItemTemplate> |
<FooterTemplate> |
<tr> |
<td></td> |
<td> |
<telerik:RadNumericTextBox ID="burstTotalValue" Type="Currency" runat="server" Value='0' MinValue='0' Width="75px" DataType="System.Int32" ReadOnly="true" > |
<NumberFormat DecimalDigits="0" /> |
<ReadOnlyStyle BorderStyle="none" HorizontalAlign="Right" /> |
</telerik:RadNumericTextBox></td> |
<td colspan="2"><asp:CompareValidator ID="burstTotalValueCheck" runat="server" |
ErrorMessage="Burst Totals must match the total investment for the assset" ControlToValidate="burstTotalValue" Type="Integer"></asp:CompareValidator></td> |
</tr> |
</table> |
</FooterTemplate> |
</asp:Repeater> |
I want to associate a javascript function to the OnDateSelected event for each of the RadDatePickers so that i can work out the number of weeks between the dates and display the value in the "datevalue" label.
I am aware of the standard paramaters that get passed to the javascript function that you assign to the OnDataSelected property, but my problem is from within that function how can I access the other RadDatePicker and also the label.
If I was able to make OnDateSelected take extra paramaters i could pass into it the client id for the other RadDatePicker and the label.
I am looking for any suggested approaches.
Thanks in advance
Jason