我有三个网格视图,我希望他们适合在一个div滚动,所以当我滚动时,所有三个将移动。这就是我所做的..
<div class="headerleft" style=" width:1299px; height:440px; border:1px solid gray; overflow: auto; ">
<div id="Div2" style="margin:50px; width:3300px;">
<asp:GridView ID="goutlet" emptydatatext="No data available." runat="server"
Width="1000px" ShowFooter="True" AutoGenerateColumns="false" HorizontalAlign="Left" CssClass="gridview">
</asp:GridView>
<asp:GridView ID="gtracking" runat="server" emptydatatext="No data available."
AutoGenerateSelectButton="True" AutoGenerateColumns="false" HorizontalAlign=NotSet
Width="1000px" ShowFooter="True" OnRowDataBound="gtracking_RowDataBound"
onselectedindexchanged="gtracking_SelectedIndexChanged"
CssClass="gridview"
>
</asp:GridView>
<asp:GridView ID="GridView1" runat="server" HorizontalAlign="Right" >
</asp:GridView>
</div>
</div>发布于 2014-08-18 19:18:07
我用样本数据测试了这段代码,它工作正常。您可以在一个div中创建三个相等的div,每个div都有一个GridView。
<div style="width:2100px;">
<div style="width:700px; float:left; height:200px;">
<asp:GridView ID="goutlet" emptydatatext="No data available." runat="server"
ShowFooter="True" AutoGenerateColumns="false" CssClass="gridview">
</asp:GridView>
</div>
<div style="width:700px; float:left; height:200px;">
<asp:GridView ID="gtracking" runat="server" emptydatatext="No data available."
AutoGenerateSelectButton="True" AutoGenerateColumns="false"
ShowFooter="True" OnRowDataBound="gtracking_RowDataBound"
onselectedindexchanged="gtracking_SelectedIndexChanged" CssClass="gridview" >
</div>
<div style="width:700px; float:left; height:200px;">
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</div>https://stackoverflow.com/questions/25357934
复制相似问题