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

Can't find ASP.NET Checkbox in Radgrid row with Client side Javascript

1 Answer 180 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 18 Jan 2011, 08:28 PM
I can't find ASP.NET Checkbox in Radgrid row with Client side Javascript in the RowDatabound event.  I would think this would be simple to do. I must be doing something silly.

I am able to find a Telerik control but not a ASP.NET control
       function RadGrid1_RowDataBound(sender, args) {
  
  
          // this works
           var radTextBox1 = args.get_item().findControl("LastName"); // find control
           radTextBox1.set_value(args.get_dataItem()["Enabled2"]);
  
           // This does not work
           var MyCheckbox = args.get_item().findControl("CheckBoxEnabled"); // find control
}

Here is the grid code

<telerik:GridTemplateColumn HeaderText="Enabled" AllowFiltering="False">
    <HeaderStyle Width="40px" />
    <ItemStyle Width="40px" />
    <ItemTemplate>
        <!-- Can find this -->
        <telerik:RadTextBox ID="LastName" runat="server" Width="80px" />
         <!-- Cannot find this -->
        <asp:CheckBox ID="CheckBoxEnabled" runat="server" />
    </ItemTemplate>
</telerik:GridTemplateColumn>


Thanks

 

 

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Jan 2011, 05:51 AM
Hello David,

You can access the asp controls using findelement method.

JavaScript:
function onRowClick(sender, args)
    {
       var label1 = args.get_gridDataItem().findElement("lblPrice");
   }

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