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

How to find Control in CommandTemplate from clientside

1 Answer 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 11 Jul 2012, 12:39 AM
I have two date picker control in the command template.

How to find those two controls from client side. I haven't found any demo for that.

sample code
 <CommandItemTemplate>
      From <telerik:RadDatePicker ID="RadDatePickerFrom" runat="server" ZIndex="30001" ShowPopupOnFocus="true" DatePopupButton-Visible="false" Width="80px" DateInput-DateFormat="M/dd/yyyy" ClientEvents-OnDateSelected="DateRangechanged"/>

     To  <telerik:RadDatePicker ID="RadDatePickerTo" runat="server" ZIndex="30001" ShowPopupOnFocus="true" DatePopupButton-Visible="false" Width="80px" DateInput-DateFormat="M/dd/yyyy" ClientEvents-OnDateSelected="DateRangechanged" />

</CommandItemTemplate>


On the clientside, i wish to use two variables
   datepickerfrom =
   datepickerto =

Thanks for help

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Jul 2012, 04:35 AM
Hello Sean,

Try the following javascript to access controls from client.
JS:
function pageLoad()
{
  var grid = $find("<%=RadGrid1.ClientID %>");
  var datepkr1 = $telerik.findControl(grid.get_element(), "RadDatePickerFrom");
  var datepkr2 = $telerik.findControl(grid.get_element(), "RadDatePickerTo");
}

Thanks,
Shinu.
Tags
Grid
Asked by
Sean
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or