scenario:
I have an asp:dataGrid. for each row in the grid there is a templateColumn containing a radDatePicker. Out to the side of each RadDatePicker i have an Image button that, when clicked, I need it to take the value of the radDatePicker that is to the left of the button and set all of the other RadDatePickers within the grid to that same value (Client Side).
Since all of the radDatePickers are within the grid, I wasn't sure how to pull the ID's of each. So instead, I was trying to get them the same class and then use Jquery to find them and then use the set_selectedDate(newDate) method on the client side. This is not working as I get the following message: Object doesn't support this property or method.
Not sure what I'm doing wrong...
here's my code:
I have an asp:dataGrid. for each row in the grid there is a templateColumn containing a radDatePicker. Out to the side of each RadDatePicker i have an Image button that, when clicked, I need it to take the value of the radDatePicker that is to the left of the button and set all of the other RadDatePickers within the grid to that same value (Client Side).
Since all of the radDatePickers are within the grid, I wasn't sure how to pull the ID's of each. So instead, I was trying to get them the same class and then use Jquery to find them and then use the set_selectedDate(newDate) method on the client side. This is not working as I get the following message: Object doesn't support this property or method.
Not sure what I'm doing wrong...
here's my code:
<script type="text/javascript"> |
function setAllCheckDates (datevalue) { |
$('.rdpControl').set_selectedDate(new Date(datevalue)); |
} |
</script> |
<asp:TemplateColumn HeaderText="Check Date"> |
<ItemTemplate> |
<telerik:RadDatePicker Visible="true" id="rdpCheckDate" Skin="Office2007" Width="100px" Runat="server" Culture="English (United States)" TabIndex="3" Font-Size="11px" EnableEmbeddedScripts="true" CssClass="rdpControl"> |
<calendar ID="Calendar1" runat="server" usecolumnheadersasselectors="False" FastNavigationStep="12" ShowRowHeaders="False" userowheadersasselectors="False" viewselectortext="x" width="170px" Skin="Office2007"></calendar> |
<DateInput ID="DateInput1" runat="server" Font-Size="11px" DateFormat="MM/dd/yyyy" EmptyMessage="mm/dd/yyyy" TabIndex="3" CssClass="checkdateinput" /> |
<datepopupbutton CssClass="RadDatePicker_btnCalendar" hoverimageurl="_images/calendar_hover.gif" imageurl="_images/calendar.gif" TabIndex="3"></datepopupbutton> |
</telerik:RadDatePicker><asp:ImageButton runat="server" ID="imgSetAllCheckDates" ImageUrl="_images/icons/icon_dates_set_all.gif" /> |
</ItemTemplate> |
</asp:TemplateColumn> |
Private Sub dgInterfaces_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgInterfaces.ItemDataBound |
Select Case e.Item.ItemType |
Case ListItemType.Item, ListItemType.AlternatingItem, ListItemType.SelectedItem |
Dim btnImgSetAllCheckDates As ImageButton = CType(e.Item.FindControl("imgSetAllCheckDates"), ImageButton) |
Dim rdpTemp As Telerik.Web.UI.RadDatePicker = CType(e.Item.FindControl("rdpCheckDate"), Telerik.Web.UI.RadDatePicker) |
btnImgSetAllCheckDates.Attributes.Add("onclick", String.Format("setAllCheckDates({0}.value);return false;", rdpTemp.DateInput.ClientID)) |
End Select |
End Sub |