http://www.fineui.com/bbs/forum.php?mod=viewthread&tid=2506&page=1

/// <summary>
        /// 选中的行
        /// </summary>
        /// <param name="grid"></param>
        /// <returns></returns>
        protected string HowManyRowsAreSelected(Grid grid)
        {
            StringBuilder sb = new StringBuilder();
            int selectedCount = grid.SelectedRowIndexArray.Length;
            if (selectedCount > 0)
            {
                sb.AppendFormat("共选中了 {0} 行:", selectedCount);
                sb.Append("<table class=\"result\">");

sb.Append("<tr><th>行号</th>");
                foreach (string datakey in grid.DataKeyNames)
                {
                    sb.AppendFormat("<th>{0}</th>", datakey);
                }
                sb.Append("</tr>");

for (int i = 0; i < selectedCount; i++)
                {
                    int rowIndex = grid.SelectedRowIndexArray[i];
                    sb.Append("<tr>");

sb.AppendFormat("<td>{0}</td>", rowIndex + 1);

// 如果是内存分页,所有分页的数据都存在,rowIndex 就是在全部数据中的顺序,而不是当前页的顺序
                    if (grid.AllowPaging && !grid.IsDatabasePaging)
                    {
                        rowIndex = grid.PageIndex * grid.PageSize + rowIndex;
                    }

object[] dataKeys = grid.DataKeys[rowIndex];
                    for (int j = 0; j < dataKeys.Length; j++)
                    {
                        sb.AppendFormat("<td>{0}</td>", dataKeys[j]);
                    }

sb.Append("</tr>");
                }
                sb.Append("</table>");
            }
            else
            {
                sb.Append("<strong>没有选中任何一行!</strong>");
            }

return sb.ToString();
        }

FineUI 选中多行获取行ID的更多相关文章

  1. jquery datatable 多行(单行)选择(select),行获取/行删除

    jquery datatable 多行(单行)选择(select),行获取/行删除 代码展示 // 示例数据源 var dataSet = [ ['Tasman','Internet Explorer ...

  2. 获取CPU ID ,disk ID, MAC ID (windows ARM linux Mac)

    windows 命令行获取CPU ID,可以用ShellExecute wmic cpu get processorid ProcessorId BFEBFBFF000506E3 开源库: 查询CPU ...

  3. resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found.

    resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found. 代码: String sql="SELECT d.co ...

  4. Jqgrid获取行id

    //获取选中行(单行)的ID var id = $("#table").jqGrid('getGridParam','selrow'); //根据id获取行数据,返回的是列表 va ...

  5. jqGrid根据ID获取行号

    根据行号获取ID $('#grid').getCell(rownumber,'id') 根据ID获取行号 $('#' + rowid)[0].rowIndex

  6. WPF DataGrid 获取选中 一行 或者 多行

    WPF中DataGrid使用时,需要将其SelectedItem转换成DataRowView进行操作 然而SelectedItem 与SelectedItems DataGrid的SelectionU ...

  7. TextView 获取行数,某一行的内容,某行的宽度

    获取行数 ViewTreeObserver vto = textView.getViewTreeObserver(); vto.addOnGlobalLayoutListener(new OnGlob ...

  8. MFC LIST 获取行数和列数

    DWORD dwStyle = dataListControl.GetExtendedStyle(); dwStyle |= LVS_EX_FULLROWSELECT;//选中某行使整行高亮(只适用与 ...

  9. LayUI之table数据表格获取行、行高亮等相关操作

    前言 目前LayUI数据表格既美观有不乏一些实用功能.基本上表格应有的操作已经具备,LayUI作者[贤心]肯定是煞费苦心去优化,此处致敬.但是实话实话,如果单纯那数据表格功能来说,EasUI的数据表格 ...

随机推荐

  1. SQL2005 安装问题

    1. 单击“开始”,依次指向“程序”.“Microsoft SQL Server 2005”和“配置工具”,然后单击“SQL Server 外围应用配置器”. 2. 在“SQL Server 2005 ...

  2. Centos7 docker 常用指令

    Docker 运行在 CentOS 7 上,要求系统为64位.系统内核版本为 3.10 以上 一.docker的安装及卸载 1.查看当前系统内核版本: [root@docker ~]# uname - ...

  3. html邮件链接和锚点链接

    锚点链接: 锚点链接: 标记:<a name="XXX"></a> 取读:<a href="#XXX"></a> ...

  4. pat 集合相似度

    L2-005. 集合相似度 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 给定两个整数集合,它们的相似度定义为:Nc/Nt*1 ...

  5. ubuntu下的烧录工具

    Flash Image Tool1.0 为了ubuntu下能够方便地烧录版本,我开发了Flash Image Tool.现在服务器(192.167.100.225)上有一份它的拷贝share/Tool ...

  6. JSP--TOMCAT-MYSQL web页面查询

    queryStudent.jsp代码如下 <%@ page language="java" contentType="text/html; charset=gb23 ...

  7. C++的类型转换:static_cast、dynamic_cast、reinterpret_cast和const_cast

    在C++中,存在类型转换,通常意味着存在缺陷(并非绝对).所以,对于类型转换,有如下几个原则:(1)尽量避免类型转换,包括隐式的类型转换(2)如果需要类型转换,尽量使用显式的类型转换,在编译期间转换( ...

  8. HDU 4240

    http://acm.hdu.edu.cn/showproblem.php?pid=4240 题意:求最大流和流量最大的一条路径的流量的比值 题解:流量最大的路径的流量在dinic的dfs每次搜到终点 ...

  9. 【c++基础】accumulate

    accumulate // accumulate example #include <iostream> // std::cout #include <functional> ...

  10. 【linux基础】ubuntu如何查看linux的内核版本和系统版本

    参考 1.查看linux内核和系统版本: 完