Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Dealing with DetailsView control programmatically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Angel - 07 Dec 2007 17:08 GMT
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,

Signature

aaa

Phil H - 08 Dec 2007 22:11 GMT
> 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
[quoted text clipped - 10 lines]
> --
> 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.
Angel - 10 Dec 2007 23:09 GMT
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

> > 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
[quoted text clipped - 24 lines]
> databound controls (e.g. FormView, GridView etc) where the normal
> behaviour doesn't meet the needs of the developer.
Angel - 12 Dec 2007 00:31 GMT
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 aamador26@hotmail.com

Signature

aaa

> 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
[quoted text clipped - 7 lines]
>
> Thanks,

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.