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

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div>
            <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="AccessDataSource1" AutoGenerateColumns="false"
                AutoGenerateEditColumn="true">
                <MasterTableView>
                    <Columns>
                        <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID" UniqueName="ProductID"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" UniqueName="ProductName"></telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn UniqueName="CategoryID" HeaderText="CategoryID" DataField="CategoryID">
                            <ItemTemplate>
                                <asp:Label ID="CategoryIdLabel" runat="server" Text='<%# Eval("CategoryID") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <div style="border:solid 1px black;">
                                <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="AccessDataSource2" 
                                DataTextField="CategoryName" DataValueField="CategoryID" RepeatDirection="Vertical" RepeatColumns="4">
                                </asp:CheckBoxList>
                                </div>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
             
            </telerik:RadGrid>
        </div>
                    
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb"
            SelectCommand="SELECT [ProductID], [ProductName], [CategoryID], [UnitPrice] FROM [Products]">
        </asp:AccessDataSource>
        
        <asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/Nwind.mdb"
            SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]"></asp:AccessDataSource>
    </form>
</body>
</html>
