DataGridView中定位项

文本框中输入信息,想在ListView中自动定位到相应的项,这种做法给客户的体验比较好...没错...

 

方法如下:


代码
foreach (DataGridViewRow row in this.dgvSystemInfo.Rows)
{
    
if (row.Cells[2].Value.Equals(this.txtSearch.Text))
    {
        
this.dgvSystemInfo.CurrentCell = row.Cells[2];//设置当前选择文本框
    }
}

  CurrentCell 属性

posted @ 2009-12-19 17:38  吴庆阳  阅读(307)  评论(0编辑  收藏  举报