Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15136

VB.net - Get the value of a specific column of a filtered data-bound datagridview

$
0
0
Hi,
I cannot find out how to get this to work.

I have a datagridview where user can fitter if based on some options they have. There is also a double-click feature that gets some additional info when a when a row is double-clicked. It is all good when no option is selected. But when the data source is changed, then the row index is still refers to the previous data even though the DGV is showing something else.

I might have misspoken by saying "filtered" as in fact I rebind the DGV with a new data source each time an option is selected:
Code:

Dim MyBindingSource As New BindingSource()
 MyBindingSource.DataSource = ThisTable

With ThisDGV 
    .DataSource = MyBindingSource
End With

Things are all good when the DGV is not "filtered", but when it is filtered the row index assumes the data from the original datagridview.

Can some one please help to find a solution to this?

Thanks in advance.

Viewing all articles
Browse latest Browse all 15136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>