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

RadGrid get reference to RadDatePicker control within EditFormTemplate on Clientside

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kavitha
Top achievements
Rank 1
kavitha asked on 03 May 2011, 08:01 PM
Hello,

   Can you tell me how to find reference to a RadDatePicker control that resides in the EditFormSettings of a RadGrid on client side javascript for validation purposes. I have spent quite some time browsing the forums and other online help  but can't find the answer.

I need this on the OnClientClick event of a button control, I have tried attaching the event from the code behind but it is not behaving correctly. So i want to get the reference to the control on client side itself.

Please Help!!!

Thanks,
Kavitha

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 May 2011, 06:26 AM
Hello Kavitha,

Since you are using RadControl one easy approach is to attatch the OnClientLoad to the RadComboBOx and save the clientID globally.
aspx:
<FormTemplate>
    <telerik:RadComboBox  OnClientLoad="OnClientLoad" ID="RadComboBox2" runat="server" DataSourceID="SqlDataSource1"DataTextField="LastName" DataValueField="LastName">
    </telerik:RadComboBox>
 </FormTemplate>

Javascript:
<script type="text/javascript">
    var combo;
    function OnClientLoad(sender)
    {
        combo = sender;
    }
</script>

Also check out the following code library.
Accessing server controls in a grid template on the client

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