Asp.net databinding to objectdatasource

G

Guest

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/>
 
G

Guest

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/>
 
G

Guest

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/>
 
Joined
Sep 28, 2008
Messages
1
Reaction score
0
kindly send me the solution of this problem i am also facing the same problem

=?Utf-8?B?UmFt?= said:
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/>

kindly send me the solution of the above mentioned problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top