473,804 Members | 3,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DetailsView defaultMode question

I have a Master/Detail page - the DetailsView is set to ReadOnly, and
AutoGenerates Delete/Edit/Insert buttons
The Gridview has records - when a record is selected, the DetailsView is
populated
I can successfully Delete/Insert/Update - no problem

However, since it's set to ReadOnly, the DetailsView is not visible when no
records are in the Gridview and the corresponding table
I need it to be visible, so I can choose the Insert capabilities, the first
time (once in production)

If I set the DetailsView to Insert for the defaultMode, it never changes
from that mode, even when a record is selected from the Gridview

I tried adding a 'CheckMode' sub, and ran it in the INSERTED and DELETED
events of the DetailsView, along with Page_Load:

If gvTransient.Row s.Count = 0 Then
dvTransient.Def aultMode = DetailsViewMode .Insert
Else
dvTransient.Def aultMode = DetailsViewMode .ReadOnly
End If

However, the defaultmode property apparently is only available when the page
initially loads, and can not be changed not on postback

Is there any other way I can achieve what I'm needing?
Jun 27 '08 #1
0 1017

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
8707
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?
0
909
by: Mark | last post by:
Hello, 1. I have a detailsview that has 'insert records' enabled, but it does not show on the webform when there is no data in the source table. Can anyone help me with this. 2. Is there a way to add records using the gridview? Any help would be greatly appreciated! Thanks in advance.
3
4075
by: chrisn | last post by:
Hi, (Using ASP.Net 2.0) I have a wizard control inside a detailsview control. When I attempt to call the InsertItem method on the DetailsView I get an error "ObjectDataSource 'ObjectDataSource1' has no values to insert. Check that the 'values' dictionary contains values." I have found I can suppress the error by placing a hidden field inside
2
7737
by: rockdale | last post by:
Hi, I am upgrading my asp.net 1.x to asp.net 2.0. In my page I have a datagrid and a group of textbox, dropdownlist, checkbox... etc. the datagrid and the group of controls are hooked up - when user click on datagrid to select a row, then I will populate the record detail to those controls for user to edit. As in asp.net 2.0, I tried to use detailsview to replace the group of controls by using <ItemTemplate>. But I do not like the...
0
2603
by: wardemon | last post by:
Hi All, I have a web structure like the following: Repeater GridView DetailView /Repeater The GridView's & the DetailView's Datasource is being changed dynamically on the Repeater's OnItemDataBound event.
0
1536
by: gsauns | last post by:
I have a DetailsView which is inside of a FormView. I lifted this DetailsView straight off another one of my pages, where it was working beautifully. Now I get this endlessly frustrating error message whenever I try to go into Edit mode: Specified argument was out of the range of valid values. Parameter name: index The DetailsView is actually inside an UpdatePanel, which is inside an Ajax Accordion, which is inside the FormView. Could...
5
3470
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:
1
1082
by: Seth Williams | last post by:
I've got a DetailsView I'm using with the Default mode being INSERT I have an XSD using the INSERT stored Procedure, and I have a Members class, which uses the XSD My question - - When I choose the Members class for the Object DataSource, it detects the parameters of the Insert_Members method. I want them to come from the DetailsView - - When configuring the Object DataSource, it gives me choices like session, querystring, etc for...
3
1483
by: SAL | last post by:
Hello, I'm using vs2005 and ajax exentions 1.0.61025.0. I have a page with a Gridview control that's inside of an update panel. I also have a DetailsView on this page inside of another update panel. The Detailsview handles the inserting of records into the Gridview. The page is behaving as expected except the ItemInserting event (and there the inserting) is being called twice. I have logic in place that is handling this but it would be...
0
9707
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
10586
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...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
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...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4301
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
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
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.