473,396 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

FormView problem

Guys,

I am working on a project, and I thought using FormView will help good
but I am running into a issue. What I have done is that in Form View in
Footer template icluded a Link Button which is servind as an edit
command. When user click it should change the Formview to Edit mode.
But when I click first on it is changing the mode to edit, it is not
diplaying the Edit Item template, I have to click again in order to get
into Edit Item template. This is getting little frustrating for me. Can
any one tell me what is going on here. Thanks,

Protected Sub LinkButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
FrmView.ChangeMode(FormViewMode.Edit)
FrmView.DefaultMode = FormViewMode.Edit

end sub

Jul 17 '06 #1
3 4752
Why are you changing both the current mode and the default mode of the
formview to edit mode? Have you tried leaving the below line out?

FrmView.DefaultMode = FormViewMode.Edit

"Geek" wrote:
Guys,

I am working on a project, and I thought using FormView will help good
but I am running into a issue. What I have done is that in Form View in
Footer template icluded a Link Button which is servind as an edit
command. When user click it should change the Formview to Edit mode.
But when I click first on it is changing the mode to edit, it is not
diplaying the Edit Item template, I have to click again in order to get
into Edit Item template. This is getting little frustrating for me. Can
any one tell me what is going on here. Thanks,

Protected Sub LinkButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
FrmView.ChangeMode(FormViewMode.Edit)
FrmView.DefaultMode = FormViewMode.Edit

end sub

Jul 17 '06 #2
yeah I did, Initially it wasn't there I was reading another forum I
thought I might need to use it just to enforce the Formivew. But
somehow it is not renedering properly even without that. And I debugged
it when I click on the link button it runs thoruhg that lin of cade and
I am getting no exceptions anywhere else.

clickon wrote:
Why are you changing both the current mode and the default mode of the
formview to edit mode? Have you tried leaving the below line out?

FrmView.DefaultMode = FormViewMode.Edit

"Geek" wrote:
Guys,

I am working on a project, and I thought using FormView will help good
but I am running into a issue. What I have done is that in Form View in
Footer template icluded a Link Button which is servind as an edit
command. When user click it should change the Formview to Edit mode.
But when I click first on it is changing the mode to edit, it is not
diplaying the Edit Item template, I have to click again in order to get
into Edit Item template. This is getting little frustrating for me. Can
any one tell me what is going on here. Thanks,

Protected Sub LinkButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
FrmView.ChangeMode(FormViewMode.Edit)
FrmView.DefaultMode = FormViewMode.Edit

end sub
Jul 17 '06 #3
Here is the code too if you want to take a look at it. I used an if
statement just for debugging purpose. I tried to see if ChangeMode
statement needs to run twice in order to work properly but thats not
the case at all. For some odd reason you have to click button second
time in order to get the EditItemTemplate to appear. And after fighting
with this I am starting to give up. I debugged my pages even from
Page_Load() function and there is nothing that can be a problem or in a
way of this event. Thanks, for your help on this.

'If (FrmView.CurrentMode = FormViewMode.ReadOnly And Page.IsPostBack)
Then
FrmView.ChangeMode(FormViewMode.Edit)

Response.Write(FrmView.CurrentMode.ToString())

'End If
clickon wrote:
Why are you changing both the current mode and the default mode of the
formview to edit mode? Have you tried leaving the below line out?

FrmView.DefaultMode = FormViewMode.Edit

"Geek" wrote:
Guys,

I am working on a project, and I thought using FormView will help good
but I am running into a issue. What I have done is that in Form View in
Footer template icluded a Link Button which is servind as an edit
command. When user click it should change the Formview to Edit mode.
But when I click first on it is changing the mode to edit, it is not
diplaying the Edit Item template, I have to click again in order to get
into Edit Item template. This is getting little frustrating for me. Can
any one tell me what is going on here. Thanks,

Protected Sub LinkButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
FrmView.ChangeMode(FormViewMode.Edit)
FrmView.DefaultMode = FormViewMode.Edit

end sub
Jul 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ottar | last post by:
I have a few numeric fields, and when I update i get the error: "Input string was not in a correct format". Next line:" System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&...
3
by: Michael Glass | last post by:
I'm working on an ASP.Net web app using VS2005 and the .Net 2.0 framework, and I have a serious problem with the page I'm currently working on. The page has, among other things, two FormViews and a...
3
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
0
by: Metal2You | last post by:
I'm working on an ASP.NET 2.0 application in Visual Studio 2005 that accesses a Sybase database back end. We're using Sybase SQL Anywhere 9.0.2.3228. I have installed and registered the Sybase...
3
by: Jurgen Appelo | last post by:
I asked this question earlier, but unfortunately the two replies I got did not solve the problem. Here it is again, but now with the code: After an Update my FormView always loses its viewstate...
7
by: Lorenzino | last post by:
Hi, I have a problem with bindings in a formview. I have a formview; in the insert template i've created a wizard control and inside it i have an HTML table with some textboxes bound to the...
4
by: J055 | last post by:
Hi I have 2 update buttons in my FormView ('Apply' and 'OK'). I want both buttons to update the data source but the 'OK' button should redirect afterwards. I can see which button is clicked...
2
by: sck10 | last post by:
Hello, I have 3 objects: LinkButton GridView FormView The LinkButton is used to open the FormView in Insert mode. The GridView provides a list of products. When the "Select" link is
0
by: =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?= | last post by:
Hello, I read some msdn and other articles about how does databinding among DataSource controls and FormView / GridView controls works but I still don't fully understand to this blackbox. I have...
0
by: LiamLiamLiam | last post by:
G'day all. I having a problem with my formview. I'll ty to explain my situation as best as i can. I have a page with a search field at the top which is just a simple asp:textbox. Below that i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.