<%@ Page Title="Products" Language="C#" EnableEventValidation="false" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="GridViewSearch_Products.aspx.cs" Inherits="Northwind45.GridViewSearch_Products" %> <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server"> <%: Scripts.Render("~/Scripts/jquery.validate.min.js") %> <%: Scripts.Render("~/Scripts/jquery.metadata.min.js") %> <%: Scripts.Render("~/Scripts/gridview-search-script.js") %> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"> <asp:Literal ID="LitSortExpression" Visible="false" runat="server" /> <asp:Literal ID="LitSortDirection" Visible="false" runat="server" /> <asp:Literal ID="LitCurrentPage" Text="1" Visible="false" runat="server" /> <asp:Literal ID="ListLastParam" Visible="false" runat="server" /> <div id="deleteConfirmationDialog"></div> <div id="errorDialog" title="An error occured during item deletion!"></div> <asp:HyperLink ID="HlnkAdd" NavigateUrl="~/AddEditProducts.aspx?operation=add" ImageUrl="~/Images/Add.gif" ToolTip="Add New Products" runat="server" /> <asp:HyperLink ID="HlnkAddNewRecord" Text="Add New Products" NavigateUrl="~/AddEditProducts.aspx?operation=add" runat="server" /> <br /><br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table class="gridviewGridLines" cellspacing="0" cellpadding="8" rules="all" border="1" id="MainContent_GridView1" style="color:Black; width: 1400px;border-collapse:collapse;"> <tr style="color:White;background-color:#5D7B9D;font-weight:bold;"> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$ProductID');" style="color:White;">Product ID</a> <asp:Image ID="ImgSortProductID" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$ProductName');" style="color:White;">Product Name</a> <asp:Image ID="ImgSortProductName" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$SupplierID');" style="color:White;">Supplier ID</a> <asp:Image ID="ImgSortSupplierID" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$CategoryID');" style="color:White;">Category ID</a> <asp:Image ID="ImgSortCategoryID" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$QuantityPerUnit');" style="color:White;">Quantity Per Unit</a> <asp:Image ID="ImgSortQuantityPerUnit" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$UnitPrice');" style="color:White;">Unit Price</a> <asp:Image ID="ImgSortUnitPrice" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$UnitsInStock');" style="color:White;">Units In Stock</a> <asp:Image ID="ImgSortUnitsInStock" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$UnitsOnOrder');" style="color:White;">Units On Order</a> <asp:Image ID="ImgSortUnitsOnOrder" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$ReorderLevel');" style="color:White;">Reorder Level</a> <asp:Image ID="ImgSortReorderLevel" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> <a href="javascript:__doPostBack('<%=GridView1.UniqueID %>','Sort$Discontinued');" style="color:White;">Discontinued</a> <asp:Image ID="ImgSortDiscontinued" ImageUrl="~/Images/Spacer.gif" AlternateText="" runat="server" /> </th> <th scope="col"> </th> <th scope="col"> </th> </tr> <tr> <td style="width:100px; text-align: center;"><asp:TextBox ID="TxtProductID" SkinID="TextBoxInline" runat="server" /></td> <td style="width:100px; text-align: center;"><asp:TextBox ID="TxtProductName" SkinID="TextBoxInline" runat="server" /></td> <td style="width:100px; text-align: center;"><asp:DropDownList ID="DdlSupplierID" SkinID="DropDownInline" SelectMethod="GetSuppliersDropDownListData" DataValueField="SupplierID" DataTextField="CompanyName" AppendDataBoundItems="true" runat="server"><asp:ListItem Value="">Select One</asp:ListItem></asp:DropDownList></td> <td style="width:100px; text-align: center;"><asp:DropDownList ID="DdlCategoryID" SkinID="DropDownInline" SelectMethod="GetCategoriesDropDownListData" DataValueField="CategoryID" DataTextField="CategoryName" AppendDataBoundItems="true" runat="server"><asp:ListItem Value="">Select One</asp:ListItem></asp:DropDownList></td> <td style="width:100px; text-align: center;"><asp:TextBox ID="TxtQuantityPerUnit" SkinID="TextBoxInline" runat="server" /></td> <td style="width:100px; text-align: center;"><asp:TextBox ID="TxtUnitPrice" SkinID="TextBoxInline" runat="server" /></td> <td style="width:100px; text-align: center;"><asp:TextBox ID="TxtUnitsInStock" SkinID="TextBoxInline" runat="server" /></td> <td style="width:100px; text-align: center;"><asp:TextBox ID="TxtUnitsOnOrder" SkinID="TextBoxInline" runat="server" /></td> <td style="width:100px; text-align: center;"><asp:TextBox ID="TxtReorderLevel" SkinID="TextBoxInline" runat="server" /></td> <td style="text-align: center;"> <asp:DropDownList ID="DdlDiscontinued" SkinID="DropDownInline" runat="server"> <asp:ListItem Value="">Select One</asp:ListItem> <asp:ListItem Value="true">True</asp:ListItem> <asp:ListItem Value="false">False</asp:ListItem> </asp:DropDownList> </td> <td style="width:60px; text-align: center;"> <asp:ImageButton ID="IBtnSearch" runat="server" ToolTip="Click to search" ImageUrl="~/Images/Search.png" Width="16" Height="16" BorderStyle="None" BackColor="Transparent" OnClick="IBtnSearch_Click" /> <asp:ImageButton ID="IBtnCancelSearch" Visible="false" runat="server" ToolTip="Cancel search" ImageUrl="~/Images/Cancel.png" Width="16" Height="16" BorderStyle="None" BackColor="Transparent" OnClick="IBtnCancelSearch_Click" CausesValidation="false" /> </td> <td style="width:30px;"></td> </tr> </table> <asp:GridView ID="GridView1" runat="server" DataKeyNames="ProductID" onsorting="GridView1_Sorting" OnRowDeleting="GridView1_RowDeleting" ShowHeader="false" onrowdatabound="GridView1_RowDataBound" SkinID="GridViewProfessionalFixedNoPaging" Width="1400"> <Columns> <asp:BoundField DataField="ProductID" HeaderText="Product ID" ReadOnly="true" SortExpression="ProductID" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="inlineGridViewItemStyle" /> <asp:BoundField DataField="ProductName" HeaderText="Product Name" ReadOnly="true" SortExpression="ProductName" ItemStyle-CssClass="inlineGridViewItemStyle" /> <asp:HyperLinkField DataTextField="SupplierID" HeaderText="Supplier ID" DataNavigateUrlFields="SupplierID" DataNavigateUrlFormatString="~/DetailSuppliers.aspx?supplierid={0}" SortExpression="SupplierID" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="inlineGridViewItemStyle" /> <asp:HyperLinkField DataTextField="CategoryID" HeaderText="Category ID" DataNavigateUrlFields="CategoryID" DataNavigateUrlFormatString="~/DetailCategories.aspx?categoryid={0}" SortExpression="CategoryID" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="inlineGridViewItemStyle" /> <asp:BoundField DataField="QuantityPerUnit" HeaderText="Quantity Per Unit" ReadOnly="true" SortExpression="QuantityPerUnit" ItemStyle-CssClass="inlineGridViewItemStyle" /> <asp:BoundField DataField="UnitPrice" HeaderText="Unit Price" ReadOnly="true" SortExpression="UnitPrice" DataFormatString="{0:c}" HtmlEncode="false" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="inlineGridViewItemStyle" /> <asp:BoundField DataField="UnitsInStock" HeaderText="Units In Stock" ReadOnly="true" SortExpression="UnitsInStock" DataFormatString="{0:N0}" HtmlEncode="false" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="inlineGridViewItemStyle" /> <asp:BoundField DataField="UnitsOnOrder" HeaderText="Units On Order" ReadOnly="true" SortExpression="UnitsOnOrder" DataFormatString="{0:N0}" HtmlEncode="false" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="inlineGridViewItemStyle" /> <asp:BoundField DataField="ReorderLevel" HeaderText="Reorder Level" ReadOnly="true" SortExpression="ReorderLevel" DataFormatString="{0:N0}" HtmlEncode="false" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="inlineGridViewItemStyle" /> <asp:CheckBoxField DataField="Discontinued" HeaderText="Discontinued" ReadOnly="true" SortExpression="Discontinued" ItemStyle-HorizontalAlign="Center" /> <asp:TemplateField> <ItemStyle Width="60px" HorizontalAlign="Center" /> <ItemTemplate> <a href="AddEditProducts.aspx?operation=update&productid=<%# Eval("ProductID") %>" title="Click to edit"><img src="Images/Edit.gif" alt="" style="border: none;" /></a> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemStyle Width="30px" HorizontalAlign="Center" /> <ItemTemplate> <asp:ImageButton ID="IBtnDelete" runat="server" ToolTip="Click to delete" CommandArgument='<%# Eval("ProductID") %>' BorderStyle="None" BackColor="Transparent" OnClientClick="javascript:return deleteItem(this.name, this.alt);" ImageUrl="~/Images/Delete.png" AlternateText='<%# Eval("ProductID") %>' Width="16" Height="16" CommandName="Delete" /> </ItemTemplate> </asp:TemplateField> </Columns> <EmptyDataTemplate>No records found!</EmptyDataTemplate> </asp:GridView> <table class="gridviewGridLines" cellspacing="0" cellpadding="8" rules="all" border="1" style="color:Black; width: 1400px;border-collapse:collapse;"> <tr class="gridviewPagerStyle" align="center" style="color:White;background-color:#5D7B9D;"> <td><asp:Literal ID="LitPager" runat="server" /></td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server" DisplayAfter="0"> <ProgressTemplate> <br /> <img src="Images/ActivityIndicator.gif" alt="" /> Processing your request. Please wait.... </ProgressTemplate> </asp:UpdateProgress> </asp:Content>