Click here to Skip to main content
16,014,662 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello sir,

I write a div tag and within the divtag I have a panel.
The panel contains a gridview.

The div tag width is 1050 and I made the panel width 100%.
I need the gridview to be 1500 (with scroll bar).
Is it possible?

I took panel width to 200% and gridview is 1500, but header row is affected.

How can I do this in a proper way?

If anybody knows, please tell me.

thanking you sir.
XML
<tr>
                            <td colspan="6" style="width:1055;" align="left">
                                <table class="tableStyleBorder "  style="width:1055px;">
                                    <tr >
                                        <td colspan="6" style="width:1050;">
                                        <div id="DivGrid" runat="server" style=" overflow: scroll; width:1050px; height: 200px;">
                                        <asp:Panel ID="PanelGrid" runat="server" Width="200%" Height="200">
                                            <asp:GridView ID="GVProductOrder" runat="server" CssClass="grid" AutoGenerateColumns="false" GridLines="Vertical" Height="200" Width="1050" PageSize="10">
                                                <HeaderStyle CssClass="HeaderStyleGrid" />
                                                <AlternatingRowStyle BackColor ="#F8F8F8" Height="10"/>
                                                <RowStyle Height="10"/>
                                                <Columns>
                                                    <asp:BoundField DataField="ItemCode" HeaderText="Item Code" HeaderStyle-Width="80" HeaderStyle-Height="20" ItemStyle-Wrap ="true" />
                                                    <asp:BoundField DataField="ItemName" HeaderText="Item Name" HeaderStyle-Width="200px" HeaderStyle-Height="20" ItemStyle-Wrap ="true" />
                                                    <asp:BoundField DataField="EanCode" HeaderText="Ean Code" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"  />
                                                    <asp:BoundField DataField="Cost" HeaderText="Cost" HeaderStyle-Width="80px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="MRP" HeaderText="MRP" HeaderStyle-Width="80px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="SP" HeaderText="SP" HeaderStyle-Width="80px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="MBQ" HeaderText="MBQ" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="Quantity" HeaderText="Quantity" HeaderStyle-Width="50px" HeaderStyle-Height="20px"/>
                                                    <asp:BoundField DataField="FreeQty" HeaderText="Free Qty" HeaderStyle-Width="50px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="FixedDisc" HeaderText="Fixed Disc" HeaderStyle-Width="50px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="Tax" HeaderText="Tax" HeaderStyle-Width="50px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="Value" HeaderText="Value" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="OnOrder" HeaderText="On Order" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="Remarks" HeaderText="Remarks" HeaderStyle-Width="300px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
                                                    <asp:BoundField DataField="Type" HeaderText="Type" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
Posted
Updated 29-Nov-10 21:50pm
v2
Comments
Dalek Dave 30-Nov-10 3:50am    
Edited for Grammar and Syntax.

1 solution

I think you should look in to the CSS for the Gridview for below one
XML
<headerstyle cssclass="HeaderStyleGrid" />

It would be differ with the bound columns height
XML
<asp:boundfield datafield="ItemCode" headertext="Item Code" headerstyle-width="80" headerstyle-height="20" itemstyle-wrap="true" xmlns:asp="#unknown" />

For bound column you have set 20 for height, but you might been set a different vale for the css class HeaderStyleGrid, so check it. Also your question is confusing little bit so I gave this here based on my guess.
 
Share this answer
 
Comments
Dalek Dave 30-Nov-10 3:50am    
Good Answer, CSS is the way to go on that.
Member 3527910 30-Nov-10 6:39am    
great

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900