SgDotNet
Singapore Professional .NET User Group -For Cool Developers

DataGridView Row Height is taller than Control Height

rated by 0 users
This post has 3 Replies | 1 Follower

Top 10 Contributor
Posts 1,096
microlau Posted: 11-13-2007 1:20 AM

Has anyone faced this problem when developing on Winforms using DataGridView?

Supposedly I have a datagridview with height defined as 100pixels, bounded to a datasource and AutoSizeRowModes set to DisplayedCells. Tat's all fine if we have rows of data which are not too "tall". Supposedly my function returns a "tall text" (with many newlines characters) which spills into say 120pixels (height). If you've experienced DataGridView enough, the end result would be a DataGridView which looks like this:

Clicking on the scollbar simply jumps to Row 2, which doesn't really allow the user to see the full text of Row 1 which has spilled over the control. Any good ideas on how to work around this?

microlau Blog: http://community.sgdotnet.org/blogs/microlau

Top 25 Contributor
Posts 184
shrink the font?

http://devpinoy.org/blogs/cruizer

Top 10 Contributor
Posts 1,096

Wink Nice try but shrinking fonts won't help. The both screen capture is merely an example of what happens in a production system, whereby each row in the dataset can show lots of information (due to some rubbish business rules).

 

microlau Blog: http://community.sgdotnet.org/blogs/microlau

Top 50 Contributor
Posts 82

Perhaps, something like "(1 line) ...", followed by full-text tooltip, or full text new screen for selected row?

Because, it seems that the DataGridView cell height is fixed (I assume it is user's requirement). Yet, the result requires higher cell to display (because of user data). So, if the data that they create can't fit into the space that they want, they really have to agree on how they want to see the "truncated" data on the grid (and perhaps followed by other place to view the complete text, should the user choose to).

Well, if it is inconvenient for the user if there are just a lot of cells with truncated data (as then the system may not quickly help the user spot the data that they want), then i guess you and your user need to sit and discuss on the right requirement again. Perhaps to increase the datagridview height, decrease the font, or what else.

 

-- Signed with Soup --
Page 1 of 1 (4 items) | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems