Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 664
  • Last Modified:

How to check that DetailsView is opened in Current Mode

I need that check that
If(DetailsView is open in Insertmode)
{
-----
}
I am not figuring out how to do it in C sharp
0
Ammar Iqbal
Asked:
Ammar Iqbal
  • 2
  • 2
  • 2
1 Solution
 
DhaestCommented:
Did you check the CurrentMode ?

if (DetailsView1.CurrentMode == DetailsViewMode.Insert)

0
 
tn-vadimcCommented:
if (DetailsView1.DefaultMode == DetailsViewMode.Insert)
...
0
 
tn-vadimcCommented:
Dhaest's anwser is correct (ignore mine, it's monday morning for me)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Ammar IqbalAuthor Commented:
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
 
DhaestCommented:
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
 
Ammar IqbalAuthor Commented:
I do n't want to use it against a button. I want it to be opened against a menu. I want my page to be opened against a menu, once that page is opened , only detailsview  is opened in insert mode.
i don't want any grid view over here
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now