Solved

Opening a DEtailsView without a GridView  directly from the menu

Posted on 2010-08-23
9
207 Views
Last Modified: 2012-05-10
Is it possible to open DetailsView in Insert Mode ,direcly from the menu. I mean I don't woant to open the GridsViews first and then the details View.

I need to implement a "Create na new user functionality." To do that , I want that whenever I click "New user" menu, A details View in insert mode is opened.
Yes I am opeing details View Mode in insert mode,  whenever I click the menu New user, but it first opens the gird view and i click the edit or new button in any of the rows, then a details view in inser mode is opened. I want to get rid of this Grid view from this functioanlity, and want DEtialsView  to be directly associated with the New user menu
0
Comment
Question by:Ammar Iqbal
  • 4
  • 3
  • 2
9 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 33498737
You can use the ChangeMode behind your button
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.changemode.aspx

Example: DetailsView1.ChangeMode(DetailsViewMode.Insert);
0
 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 33498758
Changing mode for a dEtailsMode is not a problem, As it is in my question description, that I want to use details view to create a new user, and i should not be dependant to any gridview. Just like we create an new page for new user creation , that page is openied against a menu. I am doing all that stuff in detailsview insert mode.

The only thing I needed is t owork only with DetailsView ion this page.
I hope you have understood my question
0
 
LVL 6

Accepted Solution

by:
ingriT earned 500 total points
ID: 33499997
Can't you put the DetailsView1.ChangeMode(DetailsViewMode.Insert); code in the Page_Load function?
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 33500023
I did this already, but my question is something ellse. Please read my statment carefully.
Changing mode for a dEtailsMode is not a problem, As it is in my question description, that I want to use details view to create a new user, and i should not be dependant to any gridview. Just like we create an new page for new user creation , that page is openied against a menu. I am doing all that stuff in detailsview insert mode.
 
0
 
LVL 6

Expert Comment

by:ingriT
ID: 33500048
Can't you add a gridview, with only an inserttemplate then?
Why not use a Gridview for this? And maybe you can change your topic title, because this is probably the confusing part of your question.
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 33500058
Can you take a look at this: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/detailsview.aspx

The last example is doing what you expect I believe.. see the button "Add new author"
0
 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 33500064
I do not want to use a grid view, my question is simple clear, that I need to use DEtailsView  in insert mode independetly of Gridview against the Menu items. Need some idea of how to use detailsview independently
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 33500094
I understand that, but If you take a look at the code behind of the example, perhaps you can add the same behind your menu-structure. The example will open a new, empty, detailview where you can insert your data.

Also here you can find an example where no gridview is used
Walkthrough: Editing and Inserting Data in Web Pages with the DetailsView Web Server Control  
http://msdn.microsoft.com/en-us/library/sdba1d59(v=VS.80).aspx
0
 
LVL 1

Author Closing Comment

by:Ammar Iqbal
ID: 33619023
solution was partial
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question