随笔分类 - datagrid
摘要:三种列表控件比较:Datagrid优点:1.灵活性强,内置事件丰富 2.提供分页、编辑、排序等特性 3.功能强大的Datagrid编辑器以及模板列 4.快速开发、容易部署 5.对于表格的操作非常方便 6.内置多种布局风格缺点:1.性能不高,因为每次操作必须postback回服务器 ...
阅读全文
摘要:GridView没有自动加行号的功能,记录需要行号的话,可以在模板列中使用 来显示。
阅读全文
摘要:protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int rowIndex = ((GridViewRow)((LinkButton)e.CommandSource).NamingContaine...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms ; using System.IO; namespace OutputToExecl { public class ExportXLS { public ExportXLS() ...
阅读全文
摘要:DataGrid之ItemCommand事件 如下代码是将 e.Item.Cells[3].Text;的值传个下一个跳出的页面,这个格式要记住它支持ItemCommand事件,给DataGrid添加这个事件的方法是:点击其属性面板中的闪电按钮,仔细找找,一定能找,我给你图,你看看,双击那个itemcommand即可,然后进入后台代码,在代码中添加如下事件 说明一点的是:sel是在属性生成器里找一个...
阅读全文