DataGrid传值定位选中行

 string InputStr = strVipID;
            foreach (DataGridViewRow dvr in dbgVip.Rows)
            {
                if (dvr.Cells[0].Value.ToString().StartsWith(InputStr))
                {
                    dbgVip.ClearSelection();
                    dvr.Selected = true;
                    break;
                }
            }

posted on 2009-07-20 18:02  欣路历程  阅读(531)  评论(0编辑  收藏  举报

导航