<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="eDocument.Server.Administrator.FormBox.List"  MasterPageFile="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
    <h1>Bokser</h1>
    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"/>
    <asp:GridView runat="server" ID="grid"
        DataKeyNames="Id" 
        ItemType="eDocument.Server.Administrator.FormBox.BoxWithInfo"
        AutoGenerateEditButton="False"
        SelectMethod="GetData"
        AutoGenerateColumns="false">
        <Columns>
            <asp:DynamicField DataField="Id" Visible="False" />
            <asp:DynamicField DataField="Name" HeaderText="Navn" />
            <asp:TemplateField HeaderText="Detaljer">
                <ItemTemplate>
                    <asp:LinkButton runat="server" CommandName="Action" id="btnSelectBox" Text="Velg" OnCommand="btnSelectBox_OnCommand" CommandArgument='<%#Bind("Id") %>'>Detaljer</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:templatefield HeaderText="Rediger">
				<itemtemplate>
				    <a href='Create.aspx?id=<%#Eval("Id")%>'>Rediger</a>
				</itemtemplate>
            </asp:templatefield>
            <asp:TemplateField HeaderText="Slett">
                <ItemTemplate>
                    <asp:LinkButton runat="server" CommandName="Action" id="btnDelete" Text="Slett" OnCommand="btnDelete_OnCommand" CommandArgument='<%#Bind("Id") %>'>Slett</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>