//CART.ASPX
//Declaring where the data will be taken from (datasource)
<asp:AccessDataSource
id="CartAccessDataSource"
DataFile="~/App_Data/UserDB.accdb"
runat="server"
SelectCommand="SELECT bookName, quantity, price, orderId FROM cart"
/>
//actually doing the gridview
<asp:GridView
id="CartsGridView"
runat="server" DataSourceID="CartAccessDataSource"
onrowdatabound="CartsGridView_RowDataBound" CellPadding="4" ForeColor="#333333"
GridLines="None" >
<AlternatingRowStyle BackColor="White" />
//Only declaring one column here because the rest are auto-generated
<Columns>
<asp:TemplateField HeaderText="Shopping Cart" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" ShowHeader="false" HeaderStyle-Height="40px">
<ItemTemplate>
<asp:LinkButton ID="Remove" Text="Remove" OnClick="RemoveFromCart" CommandArgument='<%# Eval("orderId") %>' CommandName="RemoveFromCart" runat="server"></asp:LinkButton>
</ItemTemplate>
<HeaderStyle Height="40px" CssClass="leftborder"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="33px"></ItemStyle>
</asp:TemplateField>
</Columns>
//style
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>