c# - search a DataGridView and then highlight the cell[s] in which the value is found? -
i have datagridview i'm feeding list
the datagridview populating perfectly, i'd able search within grid (any column) value user enters.
i've been flailing trying sneak way solution, can't find datagridview.cells[x,y] type of property.
i tried this:
string searchval = textboxvaluetofindingrid.text.trim(); (int = 0; < datagridviewplatypuselements.rowcount; i++) { (int j = 0; j < datagridviewplatypuselements.columncount; j++) { if (datagridviewplatypuselements.text.contains(searchval)) { datagridviewplatypuselements.goto*(cells[j,i]); } } } ...but, of course, datagridview.text not contain useful. need cells[x,y] property.
- i not consider harmful in case.
how about
datagridview.rows[x].cells[y].value
Comments
Post a Comment