473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Asp.net databinding to objectdatasource

Ram

I have an issue with detailsview control bound to an objectdatasource.
scenario is i have a business logic component with CRUD methods that accept
custom business entity objects. In asp.net layer I'm using gridview and
detailsview controls that gets bound to an objectdatasource control which
uses my businesslogic CRUD methods. Now If i use all databound fields, all my
selects, inserts, updates, deletes work just fine. As soon as i convert one
field into a template field and add a dropdown control, the value that i
select in dropdown control is not bound properly to my business entity
object's property.
I'm i missing something here...

Thanks,
<Ram/>
--
Thanks,
<Ram/>
Dec 1 '05 #1
2 1557
Ram
I figured out a work around for this by implementing ItemInserting event
handler. In the iteminserting event handler i do a detailsview.findcontrol ,
get a reference of dropdown control, get the selected value and add it to
e.values dictionary.
My question is is this by design? why can't template fields be automatically
bound to business object?

I appreciate any feedback comments...

Thanks,
<Ram/>
"Ram" wrote:

I have an issue with detailsview control bound to an objectdatasource.
scenario is i have a business logic component with CRUD methods that accept
custom business entity objects. In asp.net layer I'm using gridview and
detailsview controls that gets bound to an objectdatasource control which
uses my businesslogic CRUD methods. Now If i use all databound fields, all my
selects, inserts, updates, deletes work just fine. As soon as i convert one
field into a template field and add a dropdown control, the value that i
select in dropdown control is not bound properly to my business entity
object's property.
I'm i missing something here...

Thanks,
<Ram/>
--
Thanks,
<Ram/>

Dec 1 '05 #2
Ram
I guess it kind of make sense, why they are not automatically bound to
business object. if you have multiple controls in template how do you know
which one gets bound to business object property.

Thanks,
<Ram/>
"Ram" wrote:
I figured out a work around for this by implementing ItemInserting event
handler. In the iteminserting event handler i do a detailsview.findcontrol ,
get a reference of dropdown control, get the selected value and add it to
e.values dictionary.
My question is is this by design? why can't template fields be automatically
bound to business object?

I appreciate any feedback comments...

Thanks,
<Ram/>
"Ram" wrote:

I have an issue with detailsview control bound to an objectdatasource.
scenario is i have a business logic component with CRUD methods that accept
custom business entity objects. In asp.net layer I'm using gridview and
detailsview controls that gets bound to an objectdatasource control which
uses my businesslogic CRUD methods. Now If i use all databound fields, all my
selects, inserts, updates, deletes work just fine. As soon as i convert one
field into a template field and add a dropdown control, the value that i
select in dropdown control is not bound properly to my business entity
object's property.
I'm i missing something here...

Thanks,
<Ram/>
--
Thanks,
<Ram/>

Dec 1 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Bailey | last post by:
When I first built a few web pages in ASP .Net 2.0, I thought it was great. The formview and detailview contorls would automatically layout the controls for you, the update methods were...
2
by: ulrich schumacher | last post by:
Hi ASP.NET 2.0 Professionals, I've got a question concerning the new ASP.NET 2.0 DataBinding with object oriented business classes: Example: There are two business classes in my domain...
1
by: thzero | last post by:
Is there any way to do this without using the ObjectDataSource? (Apologies for the long post) I have a simple data object: public class TestDO { public TestDO() {} public ID { get; set; }...
5
by: Trail Monster | last post by:
Ok, I've been searching the net now for several days and can't find how to do this anywhere. Version: VS 2005 Professional Release, 2.0 Framework Background: I have a complex business object...
0
by: Simon Gregory | last post by:
I am currently attempting to figure out how the new databinding stucture works in ASP.NET 2.0 after working with v1.0 & v1.1 for several years. It seems that if you wish to do set up databinding...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
8
by: Joey Chömpff | last post by:
L.S., Hello is there a way to implement 2-way databinding without using the datasources from dotnet 2.0. Why would you ask? Now that's simple. I've created an object model with BusinessObjects...
0
by: Wayne Sepega | last post by:
I have the following Object DataSource <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetCustomer" TypeName="Customers" DataObjectTypeName="Customer"...
5
by: cmrchs | last post by:
Hi, I'm trying out Databinding to a Data Acces Layer using a ObjectDataSource-control The Update works fine but the Delete-method doesn't. when debugging I see that my productID-parameter is...
0
by: cmrchs | last post by:
Hi, I'm trying out Databinding to a Data Acces Layer using a GridView and ObjectDataSource-control The Update works fine but the Delete-method doesn't ??? <asp:GridView ID="GridView1"...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.