龍騎少校

玩的就是技术。ko!!!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2008年9月22日

摘要: 17.GridView加入自动求和求平均值小计 效果图: 解决方案: Code1Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1private double sum = 0;//取指定列的数据和,你要根据具体情况对待可能你要处理的是int 2... 阅读全文

posted @ 2008-09-22 22:51 龍騎少校 阅读(376) 评论(1) 推荐(0) 编辑

摘要: 16.GridView突出显示某一单元格(例如金额低于多少,分数不及格等) 效果图: 解决方案:主要是绑定后过滤 Code1Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1GridView1.DataBind(); 2for (int i = 0... 阅读全文

posted @ 2008-09-22 22:48 龍騎少校 阅读(174) 评论(0) 推荐(0) 编辑

摘要: 18.GridView数据导入Excel/Excel数据读入GridView 效果图: 解决方案:页面增加一个按钮,单击事件添加如下方法: Code1Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1protected void Button1... 阅读全文

posted @ 2008-09-22 22:45 龍騎少校 阅读(269) 评论(0) 推荐(0) 编辑

摘要: 15.GridView合并表头多重表头无错完美版(以合并3列3行举例) 效果图: 后台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Data; 3using System.C... 阅读全文

posted @ 2008-09-22 22:37 龍騎少校 阅读(289) 评论(0) 推荐(0) 编辑

摘要: 14.GridView固定表头(不用javascript只用CSS!,很好用): 效果图: CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1 2 3 4 GridView固定表头 清清月儿http://blog.csdn.net/2... 阅读全文

posted @ 2008-09-22 22:34 龍騎少校 阅读(543) 评论(0) 推荐(0) 编辑

摘要: 13.GridView弹出新页面/弹出制定大小位置新窗口: 效果图: 方案一:简单的方法,新窗口不固定大小 Code1Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1 3 4 5 6 7 ... 阅读全文

posted @ 2008-09-22 22:32 龍騎少校 阅读(619) 评论(1) 推荐(0) 编辑

摘要: 13.GridView显示隐藏某一列:本方案为月儿独创,不同于网上其他方式,我觉得用一个CheckBox更人性化,这样可以隐藏不必要的列,让用户自己选择需要出现的列,在处理多列时这是一个很好的解决方案! 效果图: 图1-开始 图2-点击显示的CheckBox后 解决方案: CodeCode highlighting produced by Actipro CodeHighlighter ... 阅读全文

posted @ 2008-09-22 22:28 龍騎少校 阅读(613) 评论(0) 推荐(0) 编辑

摘要: 12.GridView一般换行与强制换行:效果图: 首先设置gridview里有一列绑定的数据很长,显示的时候在一行里面显示,页面拉得很宽。原因是连续英文段为一个整体导致的,在RowDataBound中添加上了一句e.Row.Cells[2].Style.Add("word-break", "break-all")就可以。 如果要给所有的列增加此属性: Code1Code highlight... 阅读全文

posted @ 2008-09-22 22:22 龍騎少校 阅读(201) 评论(0) 推荐(0) 编辑

摘要: 11.GridView实现用“...”代替超长字符串: 效果图: 解决方法:数据绑定后过滤每一行即可 Code1Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1for (int i = 0; i 1public string SubStr(s... 阅读全文

posted @ 2008-09-22 22:20 龍騎少校 阅读(196) 评论(0) 推荐(0) 编辑

摘要: 10.GridView实现自定义时间货币等字符串格式: 效果图: 图1-未格式化前 解决方法:在asp.net 2.0中,如果要在绑定列中显示比如日期格式等,如果用下面的方法是显示不了的 Code1Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/... 阅读全文

posted @ 2008-09-22 22:16 龍騎少校 阅读(194) 评论(0) 推荐(0) 编辑

摘要: 9.GridView实现自动编号: 效果图: 实现方法:双击GridView的OnRowDataBound事件;在后台的GridView1_RowDataBound()方法添加代码,最后代码如下所示: 后台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.c... 阅读全文

posted @ 2008-09-22 22:05 龍騎少校 阅读(352) 评论(0) 推荐(0) 编辑

摘要: 8.GridView实现删除时弹出确认对话框: 效果图: 实现方法:双击GridView的OnRowDataBound事件;在后台的GridView1_RowDataBound()方法添加代码,最后代码如下所示: 后台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlig... 阅读全文

posted @ 2008-09-22 17:34 龍騎少校 阅读(198) 评论(0) 推荐(0) 编辑

摘要: 7.鼠标移到GridView某一行时改变该行的背景色方法二: 效果图: 做法:和上面的一样就是代码不同 后台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1protected void GridView1_RowDataBound(obje... 阅读全文

posted @ 2008-09-22 17:32 龍騎少校 阅读(173) 评论(1) 推荐(0) 编辑

摘要: 6.鼠标移到GridView某一行时改变该行的背景色方法一: 效果图: 做法:双击GridView的OnRowDataBound事件;在后台的GridView1_RowDataBound()方法添加代码,最后代码如下所示: 后台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.Code... 阅读全文

posted @ 2008-09-22 17:29 龍騎少校 阅读(263) 评论(0) 推荐(0) 编辑

摘要: 5.GridView和CheckBox结合: 效果图: 后台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1using System; 2using System.Data; 3using System.Configuration; 4us... 阅读全文

posted @ 2008-09-22 17:26 龍騎少校 阅读(216) 评论(0) 推荐(0) 编辑

摘要: 4.GridView和下拉菜单DropDownList结合: 效果图: 后台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Data; 3using System.Configura... 阅读全文

posted @ 2008-09-22 17:21 龍騎少校 阅读(263) 评论(0) 推荐(0) 编辑

摘要: 3.GridView正反双向排序:效果图:点姓名各2次的排序,点其他也一样可以。 后台代码: 后台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1using System; 2using System.Data; 3using Syste... 阅读全文

posted @ 2008-09-22 17:17 龍騎少校 阅读(243) 评论(0) 推荐(0) 编辑

摘要: 2.GridView选中,编辑,取消,删除: 效果图: 后台代码:你可以使用sqlhelper,本文没用。代码如下: 后台代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Data... 阅读全文

posted @ 2008-09-22 17:12 龍騎少校 阅读(193) 评论(0) 推荐(0) 编辑

摘要: 1.GridView无代码分页排序: 效果图: 1.AllowSorting设为True,aspx代码中是AllowSorting="True";2.默认1页10条,如果要修改每页条数,修改PageSize即可,在aspx代码中是PageSize="12"。3.默认的是单向排序的,右击GridView弹出“属性”,选择AllowSorting为True即可。 阅读全文

posted @ 2008-09-22 17:07 龍騎少校 阅读(191) 评论(0) 推荐(0) 编辑