By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,606 Members | 2,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,606 IT Pros & Developers. It's quick & easy.

Dealing with DetailsView control programmatically

P: n/a
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,

--
aaa
Dec 7 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 7 Dec, 17:08, Angel <rodoo...@hotmail.comwrote:
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,

--
aaa
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.
Dec 8 '07 #2

P: n/a
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
"Phil H" wrote:
On 7 Dec, 17:08, Angel <rodoo...@hotmail.comwrote:
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,

--
aaa

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.
Dec 10 '07 #3

P: n/a
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...tailsView.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 aa*******@hotmail.com
--
aaa
"Angel" wrote:
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,

--
aaa
Dec 12 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.