Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
459
Dynamically Changing FreeForm Cell Value During AfterCellExitEditMode Event
posted

We have a WinTree in FreeForm ViewStyle that has a cell with an embeddable editor that is is an UltraTextEditor.  In the AfterCellExitEditMode event of the WinTree, I set the value of this behind-the-scenes business enitty class property that is associated (not through databinding) to what they entered in the cell.

However, this business entity class property might format the given value to something else (for example they enter in 5.9999 and I want to actually round it to 6.0 - a simple example, it is actually more complicated than that where I can't use built-in formatting strings).  What happens is that the business entity will throw an event that the control that the WinTree sits on catches and modifies the cell appropriately to the formatted value.

This works fine when this formatting event does't happen within the chain of events of the actual cell that is being 'formatted' is being edited via the UI.  However, when in the process of editing it actually ignores the new formatted value.

 So psuedo-code looks like:

Private Sub tvwMaterials_AfterCellExitEditMode(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.AfterCellExitEditModeEventArgs) Handles tvwMaterials.AfterCellExitEditMode

Select Case e.Cell.Key

Case "Size"

businessEntity.Size = e.Cell.Value.ToString

End Select

End Sub

...changing businessEntity.Size will eventually lead to this piece of code where I'm trying to change the same cell value:

node.Cells("Size").Value = businessEntity.Size  /*This businessEntity.Size value is different than what the typed in cell value was above*/

 This same code where I'm changing the cell value works if initiated from something else besides the AfterCellExitEditMode event of the same cell.

Hopefully this made sense.  Should there be a different event where I should be updating my business entity object appropriately or a different method of updating the cell?  I've tried trying to update the EditorResolved property (using BeginEdit) but that didn't work.  Should I be trying to hook up against a specific UltraTextEditor event to do my updating (although this would still be in the 'chain' I think)?  Actually not even using an Embeddable Editor still has the same problem.

Thanks in advance for any insights.

-David