Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a datagridview with a checklist. When I scroll the vertical scroll bar, it unable to read all the text if the text is more longer than the datagridview size.

Let say it has 6 line sentences in the second row, when I scroll it, it only able to read until fourth line in that row. When I continue to scroll the bar, it will go to third row.

Any suggestion on this?

What I have tried:

The properties below is set to False
AllowUserToAddRows 
AllowUserToDeleteRows
AllowUserToOrderColumns
AllowUserToResizeColumns
AllowUserToResizeRows

and AutoSizeColumnsMode to Fill
Posted
Updated 28-May-23 23:45pm

1 solution

I'm assuming you have the Cell.Style.WrapMode set to DataGridViewTriState.True because otherwise you would get an ellipsis instead of the full text.

And there's the rub: you can't add a scroll bar to an individual cell, because of the way a DGV works - the cell painting doesn't allow for them at all, so there is not way to do what you want with a standard DGV except in edit mode and that's not what you want at all.

You'll either have to find a third party control that does what you want, or write one yourself (which is a lot of work).
The only other alternative is to do something totally different in your UI. Here's a thought (and I haven't tried it) - if you truncate the text to a single line, you may be able to use a ToolTip or similar to show the expanded full version of the text when the user hovers over it? Be pretty simple to implement and a lot less "clumsy" on the display.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900