Dealing with DetailsView control programmatically

A

Angel

I seem to understand how the control works as long as I mated to
SqlDataSource or ObjDataSource it works fine. But I do not want to flatten
my design in this manner. I am interested in how I can programmatically
manipulate the control. In other words maybe just use the data source then
extract from the control the information do with it as I see fit. The
opposite is also true. I want to be able to add or modify the data in the
detailsview control without the assistance of a SqlDatasource.

Has anyone done this? I have google this to death to no avail.

Thanks,
 
P

Phil H

I seem to understand how the control works as long as I mated to
SqlDataSource or ObjDataSource it works fine. But I do not want to flatten
my design in this manner. I am interested in how I can programmatically
manipulate the control. In other words maybe just use the data source then
extract from the control the information do with it as I see fit. The
opposite is also true. I want to be able to add or modify the data in the
detailsview control without the assistance of a SqlDatasource.

Has anyone done this? I have google this to death to no avail.

Thanks,

Why use a detailsview control for this?

If you only want to display one record (or row) of the datasource at
one time and retain the flexibility to do what you like then why not
use ordinary standalone web server controls with databinding where
appropriate? You'll have much more control of what happens when.
Furthermore if you want it to be re-usable then consider a
encapsulating it in a web user control.

This is a classic case of what I was talking about on another thread
where I posed the question about the inappropriate use of certain
databound controls (e.g. FormView, GridView etc) where the normal
behaviour doesn't meet the needs of the developer.
 
A

Angel

What exactly is appropriate use? Both the Gridview ahd DetailsView controls
have databinding to some extend. I can program against the datasource
property without ever using another abstraction

I can extract data from Gridview control programmatically with no problem at
all why not the Detailsview? You talk about improper use but give no
evidence to support your claims.

In fact, tell my what possible purpose would the detailsview control
possibly have without the use of a datasource control. It seems unatural to
me. The second item is that you are forcing me into programming
declaratively which is not what I do. I want to retain some level of
control why tease me with read part of the process and give me no simple
alternative to the write part of the process.

The point is quite mute and purely academic for my part. What I have done
is create a custom control which can mimic both what the detailsview and
formsview controls do and much more. I just was wondering if I had missed
something and thus the question.

BTW - I do not believe you are entire correct, I seen some very ugly
implementations that allow what I am talking about. Including my new custom
control.


Getting back to Appropriate use, where is it specified how these controls
are to be used? In light of what I see nothing there in the control suggest
your position so I am curious how you arrived at your opinion.--
aaa
 
A

Angel

Once again I ask a question but get no useful answer so I felt that for you
unfortunate souls looking for this information deserve more than some
unfounded statement about appropriate use. In my search I found this
url: http://www.aspdotnetcodes.com/Parent_Child_GridView_DetailsView.aspx
which provide a reasonably detailed explanation on how to use the
DetailsView control without a datasource control. Something I think is a
real world requirement. I planned to provide a working version of the same
thing in VB for those of you that may be C# chanllenged.

Intereseted send me an email (e-mail address removed)
 

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,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top