惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
Martin Fowler
Martin Fowler
爱范儿
爱范儿
IT之家
IT之家
Last Week in AI
Last Week in AI
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
The Cloudflare Blog
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog

博客园 - 探路者

编辑用户资料的时候,让用户的密码以星花显示 模仿层遮盖网页浏览区 gridview列 数字、货币和日期 显示格式 Blog常用拖动模块 摘录小代码合集[1] 注册时阅读条款倒计时控制 通用JS倒计时代码 去除网页FLASH"单击并激活此控件"解决办法 Js实现Checkbox的全选/反选 实用天气代码 银行软键盘代码 改善用户体验之密码强度提示 div制作三角图标 IE滚动条样式 【WEB控件】[GridView系列]Panel+GridView 常用CSS样式 【HTML控件】[TextBox系列]搜索输入关键字 可以移动的漂浮层 Div滚动条样式
【Web控件】[GridView系列]给GridView添加滚动条
探路者 · 2007-09-29 · via 博客园 - 探路者

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="functions_Investigate_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <style type="text/css">
     .Freezing
   {    
        position:relative ;
        table-layout:fixed;
        top:expression(this.offsetParent.scrollTop);  
        z-index: 10;
   }

.Freezing th{text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding:2px;}
</style>
</head>
<body>
    <form id="form1" runat="server">
            <div style="overflow-y: scroll; height: 200px; width: 300px">
                <!--设置Div带滚动条-->
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="3"
                    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
                    Font-Size="12px" DataKeyNames="ProductID" DataSourceID="SqlDataSource1" AllowSorting="True">
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="ProductID" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" />
                        <asp:BoundField DataField="SupplierID" HeaderText="SupplierID" SortExpression="SupplierID" />
                        <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" />
                        <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" SortExpression="CategoryID" />
                    </Columns>
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" CssClass="ms-formlabel DataGridFixedHeader" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" CssClass="Freezing" />
                </asp:GridView>
                <!--调用样式固定表头-->
            </div>
    </form>
</body>
</html>