datagridviewtextboxcell - How to detect whether a winforms DataGridViewCell.Value is entirely visible in its cell? -


i'm looking easy way of identifying whether winforms datagridviewcell.value entirely visible in cell.

if column narrow, part of value visible, , need detect situation in code.

so far i'm thinking compare width of content (with graphics.measurestring) width of cell, seems little clunky.

looking bit more elegant if possible.

thanks

from looking @ source code datagridviewcell, looks .net team decided use textrenderer measuretext function rather graphics measurestring function (see line 2924). it's not looking for, looks it'd little less clunky having retrieve graphics object.

beyond that, not believe there way whether text cell truncating value or not. has performance. datagrid not store separate cell object each cell... far memory intensive large data sets. rather, stores style information needed (usually whole column, though can override style data particular cell necessary) , the cell value (in giant object array). when comes time render cell, reuses same cell object each cell in column (calling paint on , on different cellbounds , value, etc.). during rendering know if content long, throws information away (having store , no need after rendering).

i suppose .net team have created function measuring, etc., you, again there a lot of features have been implemented. 1 wasn't.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -