473,769 Members | 5,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dealing with DetailsView control programmaticall y

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 programmaticall y
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
3 2763
On 7 Dec, 17:08, Angel <rodoo...@hotma il.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 programmaticall y
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
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 programmaticall y 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...@hotma il.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 programmaticall y
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
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*******@hotma il.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 programmaticall y
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
8705
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press update after making changes, but I don't want that update button. How can I get the updated object when the user presses one of my other action buttons?
4
16069
by: Frits van Soldt | last post by:
Hello, I hope somebody can help me with this! I have 2 listboxes in the edititemtemplate of a detailsview. In the databound event of the detailsview I would like to fill the listboxes programmatically (not through databinding). If I use detailsview.findcontrol(controlname) then an empty object is returned. How can I address these controls? Thank you for your time.
0
1064
by: Jim McGivney | last post by:
On an aspx page I have a DetailsView control that uses a template row. The item template for the row is an asp:Label. The label will contain date/time information. I would like to format the label to display information in short time format. I don't seem to be able to access the label to do this programmatically. Any suggestions are welcomed. Either programmatically or in HTML. Thanks, Jim
1
7314
by: Mark Stafford | last post by:
I am attempting to use a DetailsView control to view some data where the fields returned by the database are determined at runtime. I create the TemplateFields on the fly using a class that implements ITemplate and repopulate the Template properters of TemplateField in OnInit. And I am DataBinding by getting a DataTable from my db provider class in Page_Load event. When I databind programmatically in the Page_Load, the data displays in...
0
1869
by: Cas | last post by:
Hi, I defined a detailsview in insertmode in the .aspx file. In the code-behind, i created 6 fields and adding them to the detailsview. Independantly of the detailsview, I use the datareader to read data from a database. Now, when the second field of the datareader (dtreader.GetString(1)) contains an "x", the field created and added to the detailsview must be read-only. I tried in the code below, but i can still input data into that...
3
5295
by: =?Utf-8?B?TWlrZSBE?= | last post by:
I need to dynamically set the ReadOnly value in a BoundField in a DetailsView. The DetailsView is generated from a GridView selection and has both Edit and New buttons. I need to be able to set the readonly property on one of the fields depending on the user's group. I have tried to access the property by Detailsview1.Fields.Readonly and by Detailsview1.FindControl("Dept").Readonly but neither exist. Is it even possible to set the...
2
5511
by: makennedy | last post by:
Hi Experts, Please help, I am a newbie to ASP.NET 2.0 may be I am doing something wrong or there may be a bug somewhere. Basically I have a TreeView Control which I have created programmatically. And I want to bind the selection of a TreeNode (which is a record) from the database) to a DetailsView which shows the datatable record for the selected TreeView node in the Details View. I am using IDE : Visual Web Developer 2005 Express; OS=...
0
1010
by: =?Utf-8?B?QW5nZWw=?= | last post by:
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...
5
3466
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration: default.aspx:
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3964
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.