This is a migrated thread and some comments may be shown as answers.

Implementing two-way Data Binding for ASP.Net Web Forms with entity framework

9 Answers 337 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Olivier
Top achievements
Rank 2
Olivier asked on 24 Dec 2014, 11:30 AM

Hello
i would like to know if with the entity Framework, we can to bind the Entity to Control (textbox, raddatapicker, radcombobox, )


And after Bind All the Control to Entity Object, to save easily .

like oUser.UnbindFromControl()

//the unbind get automatically all value from textbox.

DbContext.save()


Without get all Text value from textbox , if we have mor 150 or 200 textbox.
In 2014 or 2015 asp.net Entity do not manage which visual foxpro does since 1996 , it's very hard, to get some product very heavy,
and not datacentric

Great article From Rick Strahl  : http://www.west-wind.com/presentations/aspnetdatabinding/aspnetdatabinding.asp

Same Strataframe.net framework does more .
Thanks for your help.

9 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 26 Dec 2014, 09:18 AM

Hello Olivier,

I can suggest following these materials to learn how to built data-driven applicaiton with Entity Framework and the controls in the Telerik UI for ASP.NET AJAX suite:


Also, some demos on the matter:

Regards,

Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Olivier
Top achievements
Rank 2
answered on 26 Dec 2014, 09:30 AM
Hello

For ListControl like Grid, repeater, Combobox, it's easy but it's not my question.

I speak about  Web Page detail with a lot of TextBox. like this. (150 controls)

<asp:TextBox runat="server" ID="txt_us_name"   BusinessObjectName="oUserBo" BindingField="us_name" MaxLength="35"></asp:TextBox>

With this property BusinessObjectName and BindingField

If i load my WebPage

Var oUserBo = (MyLinq Queries).ToList();

oUserBo.BindToControl();  // all textbox, comboxbox , raddatepicker get their Value or Content : Ok ?

And if i Save !

this.oUserBo.GetValueFromControl();

this.DbContext.SaveChanges();

Imagine all time i win, with 1 method to Get all value from my textbox to store in my Entity BusinessObject ?

In all your sample, you don't Have a sample with a WebForm detail view with textbox, and sample with telerik data access !

thanks
Olivier
0
Ianko
Telerik team
answered on 26 Dec 2014, 11:34 AM
Hello Olivier,

The native ASP:TextBox control does not expose a BusinessObjectName property and I am not sure what is the expected behavior by setting it to an existing instance, created in the code behind.

Please provide exact details what exactly is the required behavior and how the Telerik controls are involved in the situation.

If you are looking for a control that can dynamically create forms by binding it to a data source, you can see if the RadDataForm is the one you are looking for.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Olivier
Top achievements
Rank 2
answered on 26 Dec 2014, 02:53 PM
Hello Ianko,

i know the attributes BusinessObjectName don't exist, i expose to you a concept, which exist on foxpro, php, strataframe.net or java,
And a lot of developper want to Bind automatically a WebForm on CRM app.

I 'll create my method , but it's so bad you don't understand the easiest of the power Data Centric Solution.

Regards
Olivier,
0
Ianko
Telerik team
answered on 26 Dec 2014, 03:06 PM
Hi Olivier,

The concepts for such a solutions are rather related to other environments where such an approach is available, e.g., the ones listed and additionally MVC, Kendo, etc.

Although, when it comes to WebForms such an approach is available using another controls. Due to that using the, e.g.,  RadTextBox as a data-bound control to recreate itself based on the bound data is not a scenario that is supported as a built-in option.

As a custom solution, you can always create the controls programmatically upon the fetched data source. 

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Olivier
Top achievements
Rank 2
answered on 26 Dec 2014, 03:13 PM
Ianko,

I don't want use this , to create the controls programmatically.

In the behind code, After load data,

I start my Custom Method which browse all control in my WebForm,
i get the Property BusinessObjectName and BindingField, and i read in the Real Object to store in Text, SelectedValue or Content,

to set a real value.

And the Same before Save, a method to browse all control inside the webform to get the value.

You see the idea ?

i ll send in feed back for telerik !
0
Ianko
Telerik team
answered on 26 Dec 2014, 03:27 PM
Hi Olivier,

You should be aware that creating control for ASP.NET WebFomrs involves a native class inheritance that do not allow to create bound-able controls and bypass strict base class events, methods and rules.

Based on such hierarchy and native environmental specification I do not see how the specified model would work as expected, as in WebForms data-binding involves certain events and logic in the code behind. 

Note, that server controls are bound and created on the server and the code-behind loading cannot be avoided.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Olivier
Top achievements
Rank 2
answered on 14 Jan 2015, 02:52 PM
Hello Lanko,

The product http://www.strataframe.net/  can binding object value with two way.
For the webform and WinForm, so it's possible to create the same concept.

It's more easy to use to end quickly a good application.

i don't understand, than the base of Data Centric concept, are not thinking on first thing.

The Best Age 90's of application like : Delphi, Visual Foxpro, Clipper, visual basic, Access, or windev can binding all their object with data.
Why in 2015, the development is so Heavy Way ? we write so much line code like before.

thanks
Olivier
0
Ianko
Telerik team
answered on 15 Jan 2015, 12:19 PM
Hi Olivier,

It is not impossible, but it is something that is not supported as an OOB solution for many of the controls in the Telerik UI for ASP.NET AJAX suite. They are not designed to be bound-able and further usage of such Data Centric logic should be built manually as a custom solution or with further integration of other controls.

On a side note, you can always post a feature request in the feedback portal, so that other developers in Telerik community could vote for the existence of such feature.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Olivier
Top achievements
Rank 2
Answers by
Ianko
Telerik team
Olivier
Top achievements
Rank 2
Share this question
or