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

<%@ Register Assembly="Telerik.OpenAccess, Version=2009.1.405.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342"
    Namespace="Telerik.OpenAccess" TagPrefix="telerik" %>
<%@ 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">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <h1>
        RadGrid:</h1>
    <br />
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" DataSourceID="OpenAccessDataSource1" GridLines="None"
        AllowAutomaticUpdates="True" OnItemDataBound="RadGrid1_ItemDataBound" AutoGenerateEditColumn="true"
        AutoGenerateDeleteColumn="true" OnUpdateCommand="RadGrid1_UpdateCommand">
        <MasterTableView CellSpacing="-1" DataKeyNames="CategoryID" DataSourceID="OpenAccessDataSource1">
            <Columns>
                <telerik:GridBoundColumn DataField="CategoryID" HeaderText="CategoryID" ReadOnly="True"
                    SortExpression="CategoryID" UniqueName="CategoryID" DataType="System.Int32">
                </telerik:GridBoundColumn>
                <telerik:GridDropDownColumn UniqueName="DropDownColumn" HeaderText="CategoryName"
                    DropDownControlType="RadComboBox" DataField="CategoryName.CategoryNameId" ListTextField="CategoryNameField"
                    ListValueField="CategoryNameId" DataSourceID="OpenAccessDataSource2">
                </telerik:GridDropDownColumn>
                <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description"
                    UniqueName="Description">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="Picture" HeaderText="Picture">
                    <ItemTemplate>
                        <a href="../images/<%# Eval("Picture") %>" rel="lightbox" title="<%# Eval("Picture") %>">
                            <asp:Image runat="server" ID="ImageThumbnail" AlternateText='<%# Eval("Picture") %>'
                                ImageUrl='<%# "~/images/" + Eval("Picture")%>' Style="border-width: 0px;" />
                        </a>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadUpload ID="RadUpload1" runat="server" InputSize="20" MaxFileInputsCount="1"
                            TargetFolder="~/images/" AllowedFileExtensions=".jpg,.gif,.png"
                            InitialFileInputsCount="14" ControlObjectsVisibility="None">
                        </telerik:RadUpload>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
        <FilterMenu EnableTheming="True">
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
        </FilterMenu>
    </telerik:RadGrid>
    <telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server" ContextTypeName=""
        EnableDelete="True" EnableInsert="True" EnableUpdate="false" ObjectContextProvider="DataProvider.ObjectContextProvider1, DataProvider"
        OrderBy="" TypeName="DataProvider.Category" Where="">
    </telerik:OpenAccessDataSource>
    <telerik:OpenAccessDataSource ID="OpenAccessDataSource2" runat="server" ContextTypeName=""
        EnableDelete="True" EnableInsert="True" EnableUpdate="True" ObjectContextProvider="DataProvider.ObjectContextProvider1, DataProvider"
        OrderBy="" TypeName="DataProvider.CategoryName" Where="">
    </telerik:OpenAccessDataSource>
    </form>
</body>
</html>
