473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.Rows.Count = 0 Then
dvTransient.DefaultMode = DetailsViewMode.Insert
Else
dvTransient.DefaultMode = 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 999

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

Similar topics

12
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...
0
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...
3
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...
2
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...
0
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...
0
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...
5
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:...
1
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...
3
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.