当前位置:编程学习 > C#/ASP.NET >>

如何查看grvFile.CurrentRow.Cells["xx"] 中的项?

grvFile.CurrentRow.Cells["I_FromDesc"]

如何查看grvFile.CurrentRow.Cells["xx"] 中的项?xx有哪些?

用程序列出来 --------------------编程问答-------------------- ?数据源有哪些列就有哪些吧。。 --------------------编程问答-------------------- Just for Guess

foreach(object item in grvFile.CurrentRow.Cells)
{
   debug.writeline(item.Name)
}

I don't know what the data type in the collection --------------------编程问答--------------------
引用楼主 bkkkkk 的回复:
grvFile.CurrentRow.Cells["I_FromDesc"]

如何查看grvFile.CurrentRow.Cells["xx"] 中的项?xx有哪些?

用程序列出来

xx是数据源中的列名,要取相应Cell的值的话,在后面加上.Value。 --------------------编程问答--------------------

string CELLS = "";
            foreach (DataGridViewColumn dgc in dgv.Columns)
            {
                CELLS += dgc.DataPropertyName.ToString() + ",";
            }
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,