<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<telerik:RadCodeBlock runat="server">
    <script type="text/javascript">
        function CheckBoxClicked(checkBox) {
            var index = checkBox.parentNode.className;
            var item = $find("<%= RadGrid1.ClientID %>").get_masterTableView().get_dataItems()[index];
            var tb = item.findElement("txtDisplayName");
            if (checkBox.checked) {
                tb.disabled = false;
            }
            else {
                tb.disabled = true;
            }
        }
    </script>
</telerik:RadCodeBlock>
    <telerik:RadGrid AutoGenerateColumns="false" runat="server" ID="RadGrid1">
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn DataField="ID" HeaderText="ID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Item" HeaderText="Item">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Date" HeaderText="Date">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="Selected" HeaderText="Display" HeaderStyle-HorizontalAlign="Center"
                    HeaderStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelected" runat="server" onclick="CheckBoxClicked(this)" />
                        <asp:HiddenField runat="server" ID="Hidden" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="DisplayName" HeaderText="Label" HeaderStyle-Width="200px"
                    SortExpression="DisplayName">
                    <ItemTemplate>
                        <asp:TextBox runat="server" ID="txtDisplayName" Enabled="false"  MaxLength="255" Width="100%" ></asp:TextBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>
