Hi everyone. I'll try to keep this brief.
I currently have a windows form that has a combo box on it.. When the user selects a value, the objects values are loaded into text boxes on that form.
This all works great... when I delete the object, I call the delete, which works fine and then call a routine ClearForm() in which I set all of the text boxes to ""
My problem is that when I call ClearForm() it is setting IsDirty = true
Is there a way to clear out these text boxes without having IsDirty set to true?
Hope this makes sense!
Thanks for your time,
Shawn
Shawn,
I'm assuming you are using data binding. If you still have the text boxes bound to a CSLA object it is going to clear out the value in the CSLA object's property that the textbox is bound to when you set the textbox to "". That's object's IsDirty value is now going to be True. If you just want to clear out the textboxes and it is not valid to enter data into them I would remove the data bindings first so they won't try and update the object. If you want to have an area where the use can enter new data then you should bind the text boxes to a new instance of the class not the old deleted instance. That should set the textboxes values to be whatever the default values in your object are, most likely "" for strings without you having to do it explicitly.
Does this make sense or did I misunderstand you issue?
Thanks,
Kevin
awesome guys! thanks for the quick reply. I'll go in and see which solution is the best for my situation.
As you can probably tell I'm really new to the framework. I really like what I've seen so far, but still get confused on it at times.
Thanks again!
Copyright (c) Marimer LLC