Scrolling in a DataGrid

  • Thread starter Thread starter Thomas Beyerlein
  • Start date Start date
T

Thomas Beyerlein

Hello,
I am having a problem with my datagrid after I load it, the information
is longer than one page, so you scroll down to find the information you
want double click it and it pulls up a blank cell. The code is:
Dim x As Integer

For x = 0 To dgrSearchResults.VisibleRowCount - 1 Step 1
If dgrSearchResults.IsSelected(x) Then
CompoundSel = dgrSearchResults(x, 0)
End If
Next

If I don't have to scroll down it works.
Any ideas of what is going on

Tom
 
Hi,

This will check all the rows not just the visible ones.

Dim cm As CurrencyManager

cm = CType(Me.BindingContext(dgrSearchResults.DataSource), CurrencyManager)
For x = 0 To cm.count- 1 Step 1
If dgrSearchResults.IsSelected(x) Then
CompoundSel = dgrSearchResults(x, 0)
End If
Next

Ken
-------------------
Hello,
I am having a problem with my datagrid after I load it, the information
is longer than one page, so you scroll down to find the information you
want double click it and it pulls up a blank cell. The code is:
Dim x As Integer

For x = 0 To dgrSearchResults.VisibleRowCount - 1 Step 1
If dgrSearchResults.IsSelected(x) Then
CompoundSel = dgrSearchResults(x, 0)
End If
Next

If I don't have to scroll down it works.
Any ideas of what is going on

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top