Solved

Opening a DEtailsView without a GridView  directly from the menu

Posted on 2010-08-23
9
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 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