Smobiler上海石磨_.NET移动开发平台

标题: TableView中列名来获取Text值 [打印本页]

作者: Lincy.Lin    时间: 2016-9-30 09:46
标题: TableView中列名来获取Text值
TableView中列名来获取Text值是通过TableView1.Rows[第几行].Cells["列名称"].BindPropertyValue.ToString(),代码如下:
  1. DataTable table = new DataTable();
  2.             table.Columns.Add("ID", typeof(Int32));
  3.             table.Columns.Add("Type", typeof(String));
  4.             for (int i = 1; i <= 5; i++)
  5.             {
  6.                 table.Rows.Add(i, "t"+i.ToString ());
  7.             }
  8.             TableView1.DataSource = table;
  9.             TableView1.DataBind();
  10.             //TableView中列名来获取Text值
  11.             string type = TableView1.Rows[0].Cells["type"].BindPropertyValue.ToString();
复制代码







欢迎光临 Smobiler上海石磨_.NET移动开发平台 (https://www.smobiler.cn/) Powered by Discuz! X3.2