ASP.NET - i want to set fixed height and width for gridview..here gridview put inside panel...

Asked By msakt on 11-Jun-12 08:06 AM
Vikram Singh Saini replied to msakt on 11-Jun-12 08:27 AM
Let us know how you are binding data to gridview. Are the columns autogenerated or not?

If columns are not autogenerated, then you can use the following fix for the width and height.

<Columns>
       
<asp:ImageField DataImageUrlField="Image">
           
<HeaderStyle Width="100px" />
           
<ItemStyle Height="100px" Width="50px" />
           
</asp:ImageField>
</Columns>


If columns are autogenerated, then you can try to set height and width properties for gridview control:

<asp:GridView ID="grid" runat="server" Height="200px" Width="300px"/>