我有三栏数据GridView:系统Id、第一Name、最后一个Name,使用数据库信息。 我愿强调一行,我将使用:
dataGridView1.Rows[????].Selected = true;
The row ID I however do not know and the bindingsource keeps changing, thus row 10 could be "John Smith" in one instance but not even exist in another (I have a filter that filters out the source based on what user enters, so typing in "joh" would yield all rows where first / last name have "joh" in them, thus my list can go from 50 names to 3 in a click).
我想找到一种方式,即我如何能够选择一个基于系统Id和相应数字的行文。 我可以使用以下方法获得该系统:
systemId = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["SystemId"].Value.ToString();
现在,我只需要将其适用于选择权。 Something as dataGridView1.Columns[“SystemId”].IndexOf(system) iii 任何帮助都受到高度赞赏。