Datagridview filter by first column not dependent on name

39 Views Asked by At

What I have

dv2.RowFilter = "[Supplier Name] LIKE '"+FilterByBox.Text+"*'";

So I need something like dv2.RowFilter = firstColumn + " LIKE '"+FilterByBox.Text+"*'";

but I don't know what the first column would be called or how to grab it and set it as a variable.

1

There are 1 best solutions below

0
Alfons Deda On

If you know the row, you can call: dv2.Rows[rowIndex].Cells[0].Value.toString().

I hope I understand it correctly.