scrolling datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how can I keep track of the first visble line in my datagrid when I drag the
vertical scrollbar up or down?

To clairfy my need...
An example:

I wish to set CurrentRowIndex to be the first visible row in my datagrid
while I drag the vertical scrollbar.

Should I combine an MouseDown event with a scroll event?

Appreciate any help and code axamples in advance.
 
Hans,

The data grid doesn't support this. If anything, I would have another
data grid positioned beneath the top one, and have the top row remain fixed.
Either that, or I would work the values into the header row somehow, so that
it is always visible.

Hope this helps.
 
Hi Nicholas!

Thank you for your answer. It wasn't what I was hoping for:-(.

My problem what I'm trying to solve is...:
I have an array of images ( inside a panel besides the datagrid). These
images is depending on what is is visible in the datagrid, from first visible
to last visible row. To solve this I use a scroll event on cellchange and
keep track on Currentrowindex. The problem begins when an user starts to use
the scrollbar. I've tried to disable the scrollbar, with the result that the
hole datagrid is disabled. The user have then no possibility to traverse the
grid.

Hope you understood my problem. How can I solve this? Please help, I'm soon
desperate....

...... is there a way to import my image-array into the grid itself? ... and
if so... how?

---
Hans

Nicholas Paldino said:
Hans,

The data grid doesn't support this. If anything, I would have another
data grid positioned beneath the top one, and have the top row remain fixed.
Either that, or I would work the values into the header row somehow, so that
it is always visible.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hans said:
how can I keep track of the first visble line in my datagrid when I drag
the
vertical scrollbar up or down?

To clairfy my need...
An example:

I wish to set CurrentRowIndex to be the first visible row in my datagrid
while I drag the vertical scrollbar.

Should I combine an MouseDown event with a scroll event?

Appreciate any help and code axamples in advance.
 
Can't help with your stated problem, but I would warn you about using
CurrentRowIndex. I would suggest using CurrentCell.RowIndex, since it is
correct more often than CurrentRowIndex (which in some cases does not update
as expected).

Steve
 
Back
Top