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

[Solved] Get the CheckBox Value in Client Side

1 Answer 316 Views
Grid
This is a migrated thread and some comments may be shown as answers.
chithuraj
Top achievements
Rank 1
chithuraj asked on 21 Aug 2009, 02:25 PM
I have the CheckBox (TemplateColumn) in Grid. I need to get the value of this control in Client Side.

this is my Column Code
<telerik:GridTemplateColumn DataField="IsChecked" HeaderText="DropDown" UniqueName="colDropDown">
     <ItemTemplate>
         <asp:CheckBox ID="chkIsEmpty" runat="server" />
     </ItemTemplate>
</telerik:GridTemplateColumn>

I have tried with these JavaScript Code

var chkBox1 = $telerik.findControl(DataItems[i].get_element(), "chkIsEmpty"); alert(chkBox1.get_value());
var chkBox1 = $telerik.findElement(DataItems[i].get_element(), "chkIsEmpty"); alert(chkBox2.get_value());

But I couldn't. Please help me


Thanks!

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 21 Aug 2009, 03:43 PM
Hello Chithuraj,

Please try the following approach:

function MyFunction() 
            { 
                var grid = $find("<%= RadGrid1.ClientID%>"); 
                alert($telerik.findElement(grid.MasterTableView.get_dataItems()[0].get_element(), "chkIsEmpty").checked); 
                alert($telerik.findElement(grid.MasterTableView.get_dataItems()[1].get_element(), "chkIsEmpty").checked); 
            } 

Hope this helps

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
chithuraj
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or