Unable to set row height for grid view

Posted by GabrielHeng on Stack Overflow See other posts from Stack Overflow or by GabrielHeng
Published on 2012-12-13T11:01:55Z Indexed on 2012/12/13 11:03 UTC
Read the original article Hit count: 209

Filed under:

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.

© Stack Overflow or respective owner

Related posts about visual-studio-2010