Unable to set row height for grid view
- by GabrielHeng
I tried to set a row height for each row of my grid view in visual studio. However, it does not work. The row height will not change according to the pixel that I typed in. Here is my codes.
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataKeyNames="productID"
DataSourceID="SqlDataSource1" BackColor="White" BorderColor="#CCCCCC"
BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black"
GridLines="Horizontal" Width = "850px"
style="margin-bottom: 6px" RowStyle-Height="50px">
<AlternatingRowStyle Height="50px" />
<Columns>
<asp:CommandField ButtonType="Button" ShowDeleteButton="True"
ShowEditButton="True" />
<asp:BoundField DataField="productID" HeaderText="ProductID" ReadOnly="True"
SortExpression="productID" />
<asp:BoundField DataField="title" HeaderText="Title" SortExpression="title" />
<asp:BoundField DataField="description" HeaderText="Description"
SortExpression="description" />
<asp:BoundField DataField="price" HeaderText="Price" SortExpression="price" />
<asp:ImageField DataImageUrlField="image" HeaderText="Images"
SortExpression="image" DataImageUrlFormatString="~/images/{0}">
</asp:ImageField>
</Columns>
<FooterStyle BackColor="#CCCC99" ForeColor="Black" />
<HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F7F7F7" />
<SortedAscendingHeaderStyle BackColor="#4B4B4B" />
<SortedDescendingCellStyle BackColor="#E5E5E5" />
<SortedDescendingHeaderStyle BackColor="#242121" />
</asp:GridView>
May someone help me with it? Thanks in advance.