随笔分类 -  GridView

摘要:1.添加类文件//----------------------------------------------------------------------------------- // // Description: 动态生成复合表头帮助类 // 相邻父列头之间用'#'分隔,父列头与子列头用空格(' ')分隔,相邻子列头用逗号分隔(','). // 两行:序号#分公司#组别#本日成功签约单数 预警,续约,流失,合计#累计成功签约单数 预警,续约,流失,合计#任务数#完成比例#排名 // 三行:等级#级别#上期结存 件数,重量,比例#本期调入 阅读全文
posted @ 2013-05-10 10:05 爱智旮旯 阅读(920) 评论(0) 推荐(1) 编辑
摘要://带选择框的GridView编辑//OnClientClick="return GridViewChooseEditConfirm('ctl00_cph_gv');"function GridViewChooseEditConfirm(getGridViewClientID) { if (document.getElementById(getGridViewClientID) == null) { return false; } var objgv = document.getElementById(getGridViewClientID); if (t. 阅读全文
posted @ 2013-05-03 10:22 爱智旮旯 阅读(915) 评论(1) 推荐(0) 编辑
摘要:代码: <asp:GridView ID="gvO" runat="server" AllowPaging="True" AutoGenerateColumns="False" AllowSorting="True" Width="1080px" PageSize="20"> <Columns> <asp:TemplateField HeaderText="工程名称"> <ItemTemplat 阅读全文
posted @ 2013-04-26 14:13 爱智旮旯 阅读(518) 评论(0) 推荐(0) 编辑
摘要:(一)普通列 /// <summary> /// Gridview列的合并(普通列,不包含模板列) /// 注意:1.GridView在绑定的时候进行分组和排序,才能让相同的行放在一起 /// 2.方法应用的时机,应该在Gridview的DataBound事件中使用 /// </summary> /// <param name="gv">需要合并的GridView对象</param> /// <param name="columnIndex">所要合并列的索引</param> pub 阅读全文
posted @ 2012-10-17 15:58 爱智旮旯 阅读(1394) 评论(0) 推荐(0) 编辑
摘要:第一步:设置GridView的AllowPaging="True" 和 PageSize="20"第二步:创建GridView的分页模板 <PagerTemplate> 第<asp:Label ID="LabelCurrentPage" runat="server" Text="<%# ((GridView)Container.NamingContainer).PageIndex + 1 %>"></asp:Label> 页/共<asp:La 阅读全文
posted @ 2012-07-13 14:11 爱智旮旯 阅读(2343) 评论(2) 推荐(2) 编辑
摘要:DataGrid中首先我们假设.aspx文件中DataGrid的数据行的样式为 <AlternatingItemStyle BackColor="White" ForeColor="#284775" /> <ItemStyle BackColor="#F7F6F3" ForeColor="#333333" />则在DataGrid的ItemDataBound事件中添加如下代码即可 if (e.Item.ItemType == ListItemType.Item || e.Item.ItemT 阅读全文
posted @ 2012-05-29 11:10 爱智旮旯 阅读(595) 评论(1) 推荐(0) 编辑
摘要:GridView鼠标移动背景变色,在RowDataBound事件中添加如下代码: protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover", "javascript:c=this.style.backgroundColor;this.style.background=... 阅读全文
posted @ 2012-05-28 14:44 爱智旮旯 阅读(520) 评论(2) 推荐(0) 编辑
摘要:固定表头:第一步:在程序中添加css代码,既可以保存为单独的文件,也可以在页面中引用。Css代码如下:.Fixed{position:relative;table-layout:fixed;z-index:10;top:expression(this.offsetParent.scrollTop);}.Fixed th{ text-overflow:ellipsis; overflow:hidden; white-space:nowrap; padding:2px;}第二步:在##.aspx.cs文件后台Page_Load中引用Css代码(也可以在##.aspx文件的head标签中引用,这里不 阅读全文
posted @ 2012-05-28 14:26 爱智旮旯 阅读(5402) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示