ASP.NET中GridView 表头不动内容滚动解决法

ASP.NET中GridView 表头不动内容滚动解决法

前台




 


           
           

 


后台代码
Page_Load

this.GridView1.Attributes.Add("style", "table-layout:fixed");

---------------------------------------------------------------------------------------------------------------------

string constr = @"data source=.\mssqlserver1;database=northwind;uid=sa;pwd=123456";
            northwindDataContext ctx = new northwindDataContext(constr);
            var order = from o in ctx.Orders
                        where o.EmployeeID==4 && o.ShipCountry=="USA"
                        select o;
            var order2 = order.Take(10);
            GridView1.DataSource = order2;
            GridView1.DataBind();



你可能感兴趣的:(初入职场,.Net,asp.net,database,server)