Smooth scroll of a DataGridView cell with large amount of data

  • Thread starter Richard Lewis Haggard
  • Start date
R

Richard Lewis Haggard

I have an unbound DataGridView control that has some cells that may contain
more multi-line text than can be completely displayed in the available
screen space. When the height of its row to exceeds the DataGridView's
height, it becomes impossible to view the out of sight portion of the row.
Down arrow of the text cursor simply moves the caret down out of sight.
Contrary to expectations, the DataGridView's scroll bar doesn't smoothly
scroll. It just jumps the next row into view and the problematic row is
scrolled out of view.

Is it possible to provide a scroll mechanism that will bring into view those
areas of a cell that are out of view and, if so, how?
 
O

Oliver Sturm

Hello Richard,
Is it possible to provide a scroll mechanism that will bring into view
those areas of a cell that are out of view and, if so, how?

Are you saying you have rows that are so high that they don't fit the
screen, i.e. they are higher than your complete grid control? Seems like a
really bad UI decision to me, if that's true.

Why don't you use a cell editor instead, which the user can pop up if
she's interested in the whole cell content? That popup window could of
course use scrollbars as needed... Not sure if any of the standard cell
editors would fit the bill. You could either use the ButtonColumn type and
pop up a window on a click on the button, or create your own cell editor
type.


Oliver Sturm
 
R

Richard Lewis Haggard

Thank you for your insight into my client's feature list. This is not the
design that I favored but you know what they say, the customer is always
right.

What do you mean by 'cell editor'?
 
O

Oliver Sturm

Hello Richard,
Thank you for your insight into my client's feature list. This is not the
design that I favored but you know what they say, the customer is always
right.

I've heard people say that, but I don't agree and I've been known to refuse.
What do you mean by 'cell editor'?

Hm? Well, a cell editor for the DataGridView. It has an extensible
architecture, you know - you've seen the column types and corresponding
cell editors they deliver out of the box: text box, check editor, combo
box, ... you can create your own, rather easily actually.

Try this Google search and follow some of the links - I wanted to post you
some good MSDN links, but MSDN seems to be dead at this precise moment. In
any case I know there are some pretty good introductory articles on their
site.

http://www.google.com/search?num=20&hl=en&q=extending+datagridview+site:msdn2.microsoft.com


Oliver Sturm
 

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

Top