生疏了。c# 2003 datagrid如何获取当前格子列头文本?
dgrd_workertime.CurrentCell

解决方案 »

  1.   

    高人阿,是不是在设置DADAGRID 列头时搞个文本数组供检索?微软不会让我们这么麻烦吧。
      

  2.   

    我用的 2005 ,2003 中差不多,模仿一下:            int colIndex = this.dataGridView1.CurrentCell.ColumnIndex;            DataGridViewColumn col = this.dataGridView1.Columns[colIndex];            Console.WriteLine(string.Format("Column Name: {0}\tIndex: {1}", col.Name, col.Index));