C# gridview 显示滚动条

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/hongkaihua1987/article/details/77574891

使用DIV控件实现滚动条

<div style="width:1100px; height:300px; overflow:auto;">

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderWidth="1px" BorderColor="#3366CC" AlternatingRowStyle-BackColor="AliceBlue" BackColor="White" BorderStyle="None"CellPadding="4"Height="239px"OnSelectedIndexChanged="GridView1_SelectedIndexChanged">

</asp:GridView>

<div>

示例:


<table cellSpacing="0" borderColorDark="#3366CC" cellPadding="0" width="100%" align="center"
				borderColorLight="#ffffff" border="1">
				<TR>
					<TD width="5%">
                        平台:
					</TD>
					<TD>
						<asp:DropDownList ID="DropDownList2" runat="server">
    <asp:ListItem Selected="True" Value="0">晋中</asp:ListItem>
    <asp:ListItem Value="1">忻州</asp:ListItem> 
    </asp:DropDownList> </TD> <TD style="width: 10%">
                        业务名称:
					</TD><TD><asp:DropDownList ID="DropDownList1" runat="server" Width="211px">
    </asp:DropDownList><asp:Button ID="Button1" runat="server"
        Text="查询" OnClick="Button1_Click" /></TD></TR>
        <TR>
        <TD colspan="4">
        <div style="width:1100px; height:300px; overflow:auto;">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
        BorderWidth="1px" BorderColor="#3366CC"   AlternatingRowStyle-BackColor="AliceBlue" BackColor="White" BorderStyle="None" CellPadding="4" Height="239px" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
        <Columns>
                <asp:BoundField DataField="业务名称" HeaderText="业务名称" SortExpression="业务名称" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="时段" HeaderText="时段" SortExpression="时段" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="员工数" HeaderText="员工数" SortExpression="员工数" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="拨打量" HeaderText="拨打量" SortExpression="拨打量" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="接通量" HeaderText="接通量" SortExpression="接通量" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="虚耗量" HeaderText="虚耗量" SortExpression="虚耗量" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="系统接通量" HeaderText="系统接通量" SortExpression="系统接通量" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="员工提交量" HeaderText="员工提交量" SortExpression="员工提交量" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="点击接通量" HeaderText="点击接通量" SortExpression="点击接通量" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="成功量" HeaderText="成功量" SortExpression="成功量" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>   
                <asp:BoundField DataField="接通率" HeaderText="接通率" SortExpression="接通率" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="系统接通率" HeaderText="系统接通率" SortExpression="系统接通率" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="成功率" HeaderText="成功率" SortExpression="成功率" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
              <asp:BoundField DataField="虚耗率" HeaderText="虚耗率" SortExpression="虚耗率" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="点击拒访率" HeaderText="点击拒访率" SortExpression="点击拒访率" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="后台拒访率" HeaderText="后台拒访率" SortExpression="后台拒访率" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="ACD" HeaderText="ACD" SortExpression="ACD" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                 <asp:BoundField DataField="后台小拨" HeaderText="后台小拨" SortExpression="后台小拨" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
                 <asp:BoundField DataField="员工小拨" HeaderText="员工小拨" SortExpression="员工小拨" >
                    <ItemStyle Wrap="False" />
                    <HeaderStyle Wrap="False" />
                </asp:BoundField>
            </Columns>
        <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
        <RowStyle BackColor="White" ForeColor="#003399" />
        <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
        <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
        <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
        <AlternatingRowStyle BackColor="AliceBlue" />
        </asp:GridView>
        </div>
         </TD>
        </TR>
</table>




展开阅读全文

没有更多推荐了,返回首页