Automatic view of a selected row

1

I have a worksheet where I can load numerous records, and I also have a field to search for any record. When I search for a particular record and the system finds this ROW it is automatically selected!

Currently, when I look up the registry and the system selects the ROW , I need to manually scroll the scrollbar up to% selected%!

I would like that as soon as a ROW was selected the worksheet jumped to where that particular record was selected.

    
asked by anonymous 15.12.2016 / 21:56

1 answer

2

If your datagridview is using a BindingSource , you can use index of row found by searching the property Position . (Add this line after finding the record)

Automatically focus will be moved to the line found even if you need to use the scrollbar.

produtosBindingSource.Position = index;
    
20.12.2016 / 19:29