Smobiler上海石磨_.NET移动开发平台
标题:
TableView中列名来获取Text值
[打印本页]
作者:
Lincy.Lin
时间:
2016-9-30 09:46
标题:
TableView中列名来获取Text值
TableView中列名来获取Text值是通过TableView1.Rows[第几行].Cells["列名称"].BindPropertyValue.ToString(),代码如下:
DataTable table = new DataTable();
table.Columns.Add("ID", typeof(Int32));
table.Columns.Add("Type", typeof(String));
for (int i = 1; i <= 5; i++)
{
table.Rows.Add(i, "t"+i.ToString ());
}
TableView1.DataSource = table;
TableView1.DataBind();
//TableView中列名来获取Text值
string type = TableView1.Rows[0].Cells["type"].BindPropertyValue.ToString();
复制代码
欢迎光临 Smobiler上海石磨_.NET移动开发平台 (https://www.smobiler.cn/)
Powered by Discuz! X3.2