ASP.NET - i want to set fixed height and width for 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.

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

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"/>