Bug (?) in GridAwareTextBox

Hi, I have identified what I think is an issue with GridAwareTextBox in Studio 4.1.0.50 (it''s also reproducable in 4.2.0.37). If you press Escape in a linked GridAwareTextBox to cancel your changes, the text box sets its text to be equal to the Text of the current cell, NOT the formatted text as you might expect. I have attached a sample project which demonstrates the behaviour: just select any cell, make a change to in in the text box and press Escape. If this isn''t a bug, how can I change the behaviour so that it shows the formatted rather than the unformatted text? Thanks, Max

GridTextBug.zip

2 Replies

AD Administrator Syncfusion Team July 11, 2006 05:42 PM UTC

This is a defect that we will add to our defect database and correct in our library. I do not know of a good work around. One thing you could do is to copy our class into your project and tweak the one line that needs to be changed to correct this. Here is your sample with a MyGridAwareTextBox class that does this. http://www.syncfusion.com/Support/user/uploads/GridTextBug_23967655.zip


AD Administrator Syncfusion Team July 13, 2006 08:04 AM UTC

As our development team looked into this item, it turns out that we do want to display the Text item in this case instead of the FormattedText. The reason for this is that the GridAwareTextBox is trying to mimic the functionality of Excel''''s FormulaBar to the extent possible. In its FormulaBar, Excel always displays the formula (raw text) instead of the value (the formatted text). But we will modify our source code to expose the method as a virtual method so you can more easily derive the class and override one method to get the behavior you want instead of having to copy all teh class code into a new class.

Loader.
Up arrow icon