Link to home
Start Free TrialLog in
Avatar of Ammar Iqbal
Ammar IqbalFlag for Norway

asked on

Opening a DEtailsView without a GridView directly from the menu

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
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

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);
Avatar of Ammar Iqbal

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of ingriT
ingriT
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
 
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.
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"
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
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
solution was partial