【问题标题】:how to fit 3 gridview in a div horizontally with scroll in asp.net如何在 div 中水平放置 3 个 gridview 并在 asp.net 中滚动
【发布时间】:2014-08-18 07:08:51
【问题描述】:

我有三个 gridview 我希望它们适合 1 个带滚动的 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>

【问题讨论】:

  • 请改写你的问题

标签: html asp.net gridview


【解决方案1】:

我用示例数据测试了这段代码,它工作正常。您可以在一个 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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-27
    • 2019-12-14
    • 1970-01-01
    • 2010-09-24
    • 1970-01-01
    • 2016-08-12
    • 1970-01-01
    相关资源
    最近更新 更多