i've set the following property on my grid:
now say i put the following value into it:
case (1) - if the cell is really small, it does the following (which i like):
case (2) - if the cell is a little bigger, it does the following (i don't like this):
if it's big enough to display that elipsis, i'd rather it display another digit of precision after the decimal place. with case (1) i'm ok sacrificing precision to get the ellipsis because otherwise the user has no means of knowing whether that says 872 or 87234591.
but with case (2), the user can see the decimal point so s/he knows the absolute size of the number in there (can't confuse 872 with 8725897)
case (3) - sometimes i get this:
in this case (3) there are four periods because the decimal place is right next to the ellipsis. this is confusing.
what i'd like is these cases to show:
any advice?
I'm not sure why it's all smushed like that. It doesn't do that for me, but I suspect this might be browser-dependent. I'm using FireFox.
Anyway, try pasting the code into NotePad and then copy from there so it's formatted as raw text - that might help.
Perhaps a better thing to do might be to create a small sample project and zip it up and attach it here so folks can run it and test it out.
ack - how do i get it to not reformat my code into one big smush?
thanks, that was a big help. i decided to use a draw filter to display a little overflow "indicator" triangle in the corner of the cell instead, kind of the way excel displays a warning. this way, the user is notified that there is text overflow, but doesn't sacrifice precision by using the ellipsis.
in the following code, i make my little smaller if it's in the last cell in the row. but that doesn't seem like the right thing to do. i should be messing with the offset instead. something to do with cell / row borders, i imagine. any advice?
}
mildavi said:that sounds terrifying.
I agree. It's not going to be fun. :)
mildavi said:how do i determine how much of the text is visible?
You would handle the drawing of the TextUIElement using a DrawFilter. The element size is already determined by the grid. So you would use that as your bounding size and then use MeasureString to determine how many charactters can fit. Since you will also need to determine when the ellipsis fits, you will probably need to measure multiple times using trial-and-error to get the right string.
that sounds terrifying. how do i determine how much of the text is visible?