摘要: 因为DataGrid Web 控件的AutoGenerateColumn 属性预设为True,表示会自动产生数据源中所有的字段。如果我们想自订DataGrid Web 控制所要显示的字段,只要将AutoGenerateColumn属性设为False,并设定Columns 属性即可。其设定语法如下所示:<Property Name="Columns"><ASP:BoundColum... 阅读全文
posted @ 2009-06-17 21:19 栢芯 阅读(499) 评论(0) 推荐(0) 编辑
摘要: GridView既强大又好用。为了让它更强大、更好用,我们来写一个继承自GridView的控件。[索引页][源码下载]扩展GridView控件(10) - 自定义分页样式作者:webabcd/*正式版的实现开始*/介绍扩展GridView控件:自定义分页样式。显示总记录数、每页记录数、当前页数、总页数、首页、上一页、下一页、末页和分页按钮使用方法(设置CustomPagerSettings复合属性... 阅读全文
posted @ 2009-06-17 20:49 栢芯 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 关于datagrid的打印http://www.chinaaspx.com/article/csharp/295.htmC#中为DataGrid添加下拉列表框http://www.cnblogs.com/icesnaker/archive/2004/09/21/45015.aspxDataGrid也玩分页http://dev.csdn.net/article/32/32339.shtmDataGr... 阅读全文
posted @ 2009-06-17 20:46 栢芯 阅读(130) 评论(0) 推荐(0) 编辑
摘要: DataGrid提供了分页功能,不过看上去功能有限,但是我们可以通过DataGrid的一些属性来获取状态以及增加首页、尾页功能按钮。这里没有使用DataGrid的自定义分页功能,如果在速度效率不是很讲究的情况下,由DataGrid自己管理分页还是不错的,付出的代价就是要把整个相关数据取出来后再删选指定页的数据。好处就是开发速度快,不需要写分页的存储过程。本文事例使用的是Sql Server中的No... 阅读全文
posted @ 2009-06-17 17:15 栢芯 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 1.绑定时格式化日期方法:<ASP:BOUNDCOLUMN DATAFIELD= "JoinTime " DATAFORMATSTRING= "{0:yyyy-MM-dd} " ><ITEMSTYLE WIDTH= "18% " > </ITEMSTYLE ></ASP:BOUNDCOLUMN >2.数据控件如DataGrid/DataList等的件... 阅读全文
posted @ 2009-06-17 16:21 栢芯 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 有滚动条的ASP.Net DataGrid控件:  using System;  using System.Web.UI;  using System.Web.UI.WebControls;  using System.ComponentModel;  using System.Diagnostics;  using System.IO;  using System.Web.UI.Design.W... 阅读全文
posted @ 2009-06-17 16:15 栢芯 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 1.与数据库绑定 SqlConnection conn= new SqlConnection(ConfigurationSettings.AppSettings["job"]);//数据库连接信息 SqlCommand myCommand = new SqlCommand( "select * from info", conn ); //SQL命令 myCommand.Connection.Ope... 阅读全文
posted @ 2009-06-17 00:22 栢芯 阅读(841) 评论(0) 推荐(0) 编辑