Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 1st, 2006, 02:36 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default DetailsView Issue.

Hi there,

I am using a GridView and displaying details in a Detailsview control. Now then I select a Row in the Gridview the details on for that record shows on the Detailsview control, but when there is/are not related records on the detailsview, the detailsview does not show at all. the functionality that I'm looking for is when I select a Row on the Gridview, if that specific record does not have a related record or the PrimaryKey does not exist on the details table, I want the detailsview to automatically goes on Insert Mode so the user can star creating detail records for the parent record.

Now, how can I tell when the detailsview control did not bring any records from the database?

Thanks very much.

Midway

  #2 (permalink)  
Old September 15th, 2006, 10:48 PM
Friend of Wrox
Points: 793, Level: 10
Points: 793, Level: 10 Points: 793, Level: 10 Points: 793, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2005
Location: OKC, OK, USA.
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts
Default

Midway:
It would helpful to know how your database tables, in the parent-child relationship tables reference in your topic. However, my response is based on the relationship " each and every child (or detail record MUST belong or have one and only one Parent(master record). This would also means that a child record would not exist unless there was a Parent record, but a Parent record could exist, but no child/children records. Consider the following as part of the resolution:

1--As part of your Parent record you could highlight or underline or have a bit-switch to indicate the Parent or Master record is without the child or detail records.

2--Or displayed with each Parent record have an "Add Detail" Button if the Detail record already exist, then the "Add Detail"Button would be "grayed out".

One way to test the above: In a query, you could match the parent record with child record indicating a LEFT JOIN making a temp table, the query the temp table for blank child record. A Query, using the RIGHT JOIN will indicate blank parent records. I hope this did not confuse you more, if so email me.

I hope this helps.
  #3 (permalink)  
Old November 29th, 2006, 06:55 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the same question/issue that midway11 has, but would need to deal with it programmatically. Take the following scenario - I have an entry in the aspnet_users table after login and then want to create a corresponding record in a different table based on that username. If I automatically go directly to a detailsview to be able to edit/view the information it just returns a blank screen since there is no data yet in that second table, instead of being able to do an insert. How can you get it to do an insert if there is no data found in the select query for that detailsview?

Thanks, this is a very important issue I am trying to tackle.
  #4 (permalink)  
Old November 30th, 2006, 05:35 AM
Friend of Wrox
Points: 793, Level: 10
Points: 793, Level: 10 Points: 793, Level: 10 Points: 793, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2005
Location: OKC, OK, USA.
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts
Default

drewid:
It is not clear from your scenario "the when" you would want this event to occur, right after the login? Do you use _VIEWSTATE? And/or Page_Init?
  #5 (permalink)  
Old December 1st, 2006, 03:08 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually I would want to go to the detailsview after account creation (I am using the wizard). The FinishDestinationPageUrl would go to this page.

I am having issues getting this to default into an insert view, which would then go to a detail view after the insert. I can set the default to insert, but it then goes back to a blank insert screen after it inserts the record.

Ideal scenario:
1) Account is created
2) Next page is additional account details (I used the captured UserName on this page - is working fine)
3) The intial view on the additional account details page is an "insert" view so the additional account details record can be created in the corresponding table.
4) After insert it then takes me to a "details" view

*) Ideally I'd like to be able to use this same page to "insert" a record if no corresponding record exists; or "view" the information if a record does exist.
  #6 (permalink)  
Old December 4th, 2006, 11:51 AM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi , first of all , u cant do it. Only empty data template is displayed when there is no data to bound.
So think of other way of design.If there is no data, then emptydata template is displayed.U can place button in that template with "add new data " text. Then u can make the details view to insert mode.


 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DetailsView faithfulman ASP.NET 2.0 Basics 1 September 22nd, 2006 11:16 PM
detailsview pau5160 ASP.NET 2.0 Basics 0 August 21st, 2006 10:47 PM
dropdownlist value into detailsview: how? hertendreef ASP.NET 2.0 Professional 0 June 26th, 2006 01:54 AM
Gridview & DetailsView Database Image Issue ayadrocks ASP.NET 2.0 Basics 1 December 27th, 2005 05:50 PM



All times are GMT -4. The time now is 06:32 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.