<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <asp:ScriptManager runat="server" ID="ScriptManager1">
    </asp:ScriptManager>
    
    <script type="text/javascript">
    
    function rowClick(sender, eventArgs)
    {  
    var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView();
    var contactName = masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()], "Template1"); 
    var textBox = contactName.childNodes[0];
    textBox.value = "Default Value";
    }
    
    </script>
    
    <telerik:RadGrid
     runat="server" ID="RadGrid1" DataSourceID="AccessDataSource1" GridLines="None" OnPreRender="Radgrid1_PreRender" 
     ShowGroupPanel="True" AllowFilteringByColumn="True" AllowPaging="True">
        <HeaderContextMenu EnableTheming="True">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </HeaderContextMenu>        
        <MasterTableView DataSourceID="AccessDataSource1"
         UseAllDataFields="True"
         ShowGroupFooter="True">       
         
         <Columns>
         <telerik:GridTemplateColumn UniqueName="Template1">
         <ItemTemplate>
         <asp:TextBox runat="server" ID="textBox1">
         </asp:TextBox>
         </ItemTemplate>
         </telerik:GridTemplateColumn>
         </Columns>
         
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
        </MasterTableView>
        <FilterMenu EnableTheming="True">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </FilterMenu> 
        
        <ClientSettings>
        <ClientEvents OnRowClick="rowClick" />
        </ClientSettings>
               
    </telerik:RadGrid>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb"
        SelectCommand="Select CustomerID, CompanyName, ContactName From Customers"></asp:AccessDataSource>
        &nbsp;<br />
    
    </div>
    </form>
</body>
</html>
