ASp.Net Gridview wider than parent DIV
2 answers
Due to the nature of the table, the minimum width cannot be dropped below, and the width is determined by the width of the elements in each row of the table. I assume you have already specified the width of the GridView and are still overflowing because the data is too large. You can try adding the GridView to another div and specify css properties for that div to control overflow, like this:
<div style="overflow: scroll; width: 800px; Height: 300px;">
<asp:GridView id="GridView1" runat="server" />
</div>
Now, if your GridView exceeds the dimensions of the containing div, the div will remain fixed in size and any overflow will cause the scrollbars to appear.
+3
a source to share