| | |
| | | _allBindingList.Add(new PumpSingleMatchingViewModel(Main)); |
| | | } |
| | | this.gridControl2.DataSource = _allBindingList; |
| | | // this.searchControl1.Text = pumpMatchingViewModel.ModelType; |
| | | this.searchControl1.Text = pumpMatchingViewModel.ModelType; |
| | | for (int i = 0; i < _allBindingList.Count; i++) |
| | | { |
| | | if (long.TryParse(pumpMatchingViewModel.DbId, out long dbID)) |
| | | { |
| | | if (_allBindingList[i].ID == dbID) |
| | | { |
| | | // 设置第i行为当前聚焦行 |
| | | gridView2.FocusedRowHandle = i; |
| | | |
| | | /* // 假设你想让第二列(索引从0开始)成为聚焦列 |
| | | int columnIndexToFocus = 1; |
| | | gridView2.FocusedColumn = gridView1.Columns[columnIndexToFocus]; |
| | | |
| | | // 如果你知道列名而不是索引,也可以通过名字来查找列 |
| | | // gridView1.FocusedColumn = gridView1.Columns["YourColumnName"];*/ |
| | | } |
| | | } |
| | | } |