<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <telerik:RadCodeBlock runat="server">
        <script type="text/javascript">
            function SelectShoppingList_RowClick(sender, eventArgs) {
                var e = event || window.event;
                if (e.srcElement.tagName.toUpperCase() == "SPAN") {
                }
                else {
                    alert("Pure row click");
                }
            }
        </script>
    </telerik:RadCodeBlock>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="false">
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            <ClientEvents OnRowClick="SelectShoppingList_RowClick" />
        </ClientSettings>
        <MasterTableView DataKeyNames="Account_ID, List_ID" ClientDataKeyNames="Account_ID, List_ID">
            <Columns>
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="SelectList" CommandArgument="Account_ID, List_ID"
                    ImageUrl="../Images/btSelectCharcoal.gif" Visible="false" UniqueName="SelectColumn">
                </telerik:GridButtonColumn>
                <telerik:GridTemplateColumn UniqueName="TemplateColumn" ItemStyle-Width="400px">
                    <ItemTemplate>
                        <asp:Label ID="lblTemplateName" runat="server" CssClass="slListName"> <%# DataBinder.Eval(Container.DataItem, "List_Name")%></asp:Label><br />
                        <asp:Label ID="lblLastUpdated" runat="server" CssClass="slDetailLine"> <%# DataBinder.Eval(Container.DataItem, "Detail_Line")%></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn UniqueName="ItemsColumn" DataField="Item_Count_Display"
                    ItemStyle-Width="80px" ItemStyle-CssClass="slItemCount">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="CommandsColumn">
                    <ItemTemplate>
                        <telerik:RadButton ID="btnRename" runat="server" CommandName="RenameList" CommandArgument="Account_ID, List_ID"
                            Text="Rename" UniqueName="RenameColumn" ButtonType="LinkButton" BorderWidth="0"
                            Font-Underline="true" BackColor="#063648" ForeColor="White">
                        </telerik:RadButton>
                        <br />
                        <telerik:RadButton ID="btnDelete" runat="server" CommandName="DeleteList" CommandArgument="Account_ID, List_ID"
                            Text="Delete" UniqueName="DeleteColumn" ButtonType="LinkButton" BorderWidth="0"
                            Font-Underline="true" BackColor="#063648" ForeColor="White">
                        </telerik:RadButton>
                        <telerik:RadButton ID="btnCancel" runat="server" Width="72" Height="31">
                            <Image ImageUrl="../Images/btCancelCharcoal.gif" />
                        </telerik:RadButton>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridButtonColumn FilterControlAltText="Filter DeleteCol column" UniqueName="DeleteCol"
                    ButtonType="ImageButton" CommandName="DeleteItemFromShoppingList" CommandArgument="Account_ID,List_ID"
                    ConfirmText="Are you sure you want to delete this item from the list ?" ConfirmTitle="Delete List"
                    ImageUrl="..\Images\icoDeleteRedX.gif" ItemStyle-HorizontalAlign="Left">
                </telerik:GridButtonColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>
