<%@ 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.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></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" ID="ScriptManager1">          
        </asp:ScriptManager>
    <div>
        <telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="False"
            AllowPaging="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
            AllowAutomaticUpdates="True" AutoGenerateDeleteColumn="True" 
            AutoGenerateEditColumn="True" DataSourceID="LinqDataSource1" GridLines="None">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView DataKeyNames="OrderID" DataSourceID="LinqDataSource1" CommandItemDisplay="Top">              
                <Columns>
                    <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32" 
                        HeaderText="OrderID" ReadOnly="True" SortExpression="OrderID" 
                        UniqueName="OrderID">
                    </telerik:GridBoundColumn>
                    <telerik:GridDropDownColumn DataField="CustomerID" HeaderText="CustomerID" 
                        ListTextField="ContactName" ListValueField="CustomerID" DataSourceID="LinqDataSource2">
                    </telerik:GridDropDownColumn>
                    <telerik:GridDropDownColumn DataField="EmployeeID" HeaderText="EmployeeID" 
                        ListTextField="LastName" ListValueField="EmployeeID" DataSourceID="LinqDataSource3">
                    </telerik:GridDropDownColumn>                                     
                    <telerik:GridBoundColumn DataField="ShipVia" DataType="System.Int32" 
                        HeaderText="ShipVia" SortExpression="ShipVia" UniqueName="ShipVia">
                    </telerik:GridBoundColumn>                    
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
            ContextTypeName="DataClassesDataContext" TableName="Orders"
            EnableDelete="true" EnableInsert="true" EnableUpdate="true">
        </asp:LinqDataSource>
        
        <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
            ContextTypeName="DataClassesDataContext" TableName="Customers" 
            Select="new (CustomerID, ContactName)">
        </asp:LinqDataSource>
        
         <asp:LinqDataSource ID="LinqDataSource3" runat="server" 
            ContextTypeName="DataClassesDataContext" TableName="Employees" 
            Select="new (EmployeeID, LastName)">
        </asp:LinqDataSource>
        
    </div>
    </form>
</body>
</html>
