You guys use databinding?

Posts   
 
    
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 06-Nov-2004 14:56:48   

I know in the old VB6 days, you would be dragged outside and flogged if you were caught using databinding. wink

Since the .NET databinding infrastructure has been re-vamped from the ground up, and I was wondering if you guys use it. I find it great when binding to grids, but not sure about the other controls, like textbox's, combobox's, etc. I find it a little tedious to keep creating event handlers for the bindingmanagers format and parse events.

Any thoughts?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 07-Nov-2004 10:42:58   

I often opt for a simple routine to fill combo boxes, for example in the situation where the choice is optional. However in grids, it's often easier to simply bind to the grid and let the grid do it's work.

The point is though that I really hate grids simple_smile , for some situations, they're great, like showing tabular data/working with tabular data, but in a lot of situations, grids are just a very bad GUI option, however are an easy way to develop an editor to edit 'bulk' information.

Frans Bouma | Lead developer LLBLGen Pro
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 07-Nov-2004 15:32:11   

What about textbox's, do you use databinding or just set the properties on load and set your entities fields on save.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 07-Nov-2004 20:19:45   

It depends, but most of the time I don't use databinding for that. Databinding causes you to write MORE code simple_smile First you have to define a dummy, a copy and set all properties, then bind the dummy to the controls, then read back the dummy's data into the real object IF the user clicked OK, otherwise discard the dummy.

The dummy is not needed if the user doesn't have the ability to click cancel in the middle of an update, but if he has, databinding is really just more work.

Frans Bouma | Lead developer LLBLGen Pro
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 07-Nov-2004 20:33:58   

Otis wrote:

It depends, but most of the time I don't use databinding for that. Databinding causes you to write MORE code simple_smile First you have to define a dummy, a copy and set all properties, then bind the dummy to the controls, then read back the dummy's data into the real object IF the user clicked OK, otherwise discard the dummy.

The dummy is not needed if the user doesn't have the ability to click cancel in the middle of an update, but if he has, databinding is really just more work.

Good point, but doesn't the SaveFields() method help alleviate the extra work or am I missing something?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 07-Nov-2004 21:14:46   

heh, yeah in the situation where an entity is bound, you can perfectly use that, good point! simple_smile In the case of normal objects however, it's hardly worth the effort.

Frans Bouma | Lead developer LLBLGen Pro