.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Enable Editing Not Available When Using FormView

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :ASP.Net

I have Visual Web Developer 2010 Express on Vista Ultimate x64.  I've watched various video tutorials on how to set up and use the GridView and FormView.  However, I have been unable to get the FormView to make the Enable Editing option available.  I need to create a web page that retrieves one record and allows the user to edit the displayed data.

I'm using SQL Server database and I'm connecting the FormView to SqlDataSource1.  I'm setting up a custom SQL statement using Query Builder.  I test the SQL and it returns the selected record - no problem.  The table I'm accessing has no uniqueidentifier columns, but it does have a Primary Key column.  The rest of the columns are just varchar, tinyint, and date.

But after I'm done setting up the FormView, I notice that the Enable Editing option is not available.  What might be causing the Enable Editing option to not be available?  Thanks.

View Complete Post

More Related Resource Links

Enable Editing option not available in FormView


I'm using Visual Web Developer 2010 and SQL Server 2008 R2.  I have a table that does not have any uniqueidentifier columns.  It's got a UserName column that I have set as a Primary Key and a few other varchar columns.  I'm trying to create a web page with a FormView control that will allow individual users to enter or edit their information after their record has been retrieved.

I'm dragging the FormView onto the form, selecting SQL Database and my data connection, and selecting Specify a Custom SQL starement or stored procedure.  Then I enter my SQL statement using Query Builder and test it using Test Query.  It retrieves the record - no problem.  I then hit Finish and it returns me to the Design View of my web page.  But to my dismay, the list of enableable features for my FormView is limited to only

  • Enable Dynamic Data support
  • Enable Paging

The only option I actually need is Enable Editing but it's not there.  In all the online video tutorials that I've seen on the subject, the Enable Editing option is always there and there's never any mention of it not being there under certain circumstances.  What might be the cause of the Enable Editing option missing from my FormView? 

How Do I Enable Inline GridView Editing?

Now that you have created a site with Edit and Details views, how do you enable inline editing in a GridView control? This video shows you how, and also touches on routing.

editing gridview in a formview in a formview... yikes.

Oh dear - I don't know how it came to this but I could really do with a bit of help.I have a gridview which has editable columns. The gridview lives in a formview, which lives in another formview.Inside one column is an end date. This column has a textbox which gets it's value when I choose a date from a calendar control. However, when I choose a date from the calendar control, the program crashes instead of populating the text box.Here is the page and the selectedIndexChanged sub for the piece of work I'm trying to accomplish...dim rowid as integer Protected Sub Calendar2_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) 'Assign value to textbox from Calendar Dim tmp As FormView = Me.FormView1.FindControl("formview3") Dim tmpgridview As GridView = tmp.FindControl("gridview2") CType(tmpgridview.Rows(rowid).FindControl("textbox3"), TextBox).Text = CType(tmpgridview.Rows(rowid).FindControl("Calendar2"), Calendar).SelectedDate End Sub Gridview2 is inside formview3 inside formview1I have included the whole page below, but the problem area is gridview2<%@ Page Language="VB" MasterPageFile="~/myMasterPage.master" AutoEventWireup="false" CodeFile="user_profile.aspx.vb" Inherits="user_profile" title="View Profile - A

Editing the Data in a GridView

In addition to deleting a GridView's underlying data, another common need is to allow end users to edit the data displayed in a GridView. With ASP.NET 1.x's DataGrid control, editing the data is certainly possible, but requires creating three event handlers and writing a dozen or so lines of code. With the GridView and ASP.NET 2.0, it is possible to create an editable GridView without writing a single line of code! All of the necessary functionality is encapsulated within the GridView.

The GridView allows editing on a row-by-row basis. An editable GridView contains an additional column with an Edit button in each row. When the end user clicks on an Edit button that row becomes editable, causing the Edit button to change to Update and Cancel buttons and the other columns to become TextBoxes. The end user can then update one or more column values and click Update to save their changes.

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

Gridview with a dropdown list for editing


Hello. I am working through Scott Mitchell's ASP.Net in 24 hours book. I am finishing the photo album project.

I have a GridView that retrieves a list of uploaded photo rows for the logged-in user.
The GridView is for editing and deleting rows.

The photo Category field in the Gridview is a dropdown list. The text entry field was deleted after converting this field to a Template.

Like the uploaded photos, these Categories are user-specific. They are created in another web page.

Users also have the option to select "none" for the category when they upload an image.

For the GridView:  The Category ID field's ItemTemplate and EditItemTemplate both have a " - None - " choice added to them.

I am getting this error:

'pictureReadOnlyCategories' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value


Note: The ID for the ItemTemplate for that dropdown list is the ID listed above in the error: "pictureReadOnlyCategories".


Am I missing some step in this process of changing a GridViews text field to a dropdown that can be used for editing? I went through the book's instructions three times.

Here is my code for the dropdown list and a screenshot of the Design

Formview LinqData source not allowing updates


OK, I'm confused.  I've set up a formview with a Linqdata source to allow users to edit records.  When I run it, edit data and submit, it blows up and tells me "Linq datasource6  does not support the Select property when the Delete, Insert or Update operations are enabled."  I googled that warning and saw a couple of posts on this forum saying the problem is the slect statement has to be removed from the Linq data source for it to allow updates. 

But if I remove the select statement then how do I show the user specific info on pageload?   plus I thought the two way databind was an advantge of the datasource control.




Gridview Enable Selection Problem



I have a gridview with Enable selection and Enable Paging equals to TRUE.

I also set the PageSize of my gridview to 4 so that I only displays 4 rows per page.

The problem is when I click the pager in the bottom of my gridview, my gridview is disappearing and no records appear.

Here is code behind of my gridview:

If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Attributes("style") = "cursor:pointer"

                e.Row.Cells(2).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(3).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(4).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(5).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(6).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))

FormView -- Parameters and asp:Table


I've already solved this problem to my satisfaction, I just want to know WHY it works this way.

I have a FormView control bound to an ObjectDataSource.  Let's say our data source is a hypothetical table with three columns:  id, name, age.  Why is it that when I use the <asp:Table> element inside of the FormView, the parameter values are not set, but when I use the standard <table> tag, it works fine?

This seems like a .NET problem to me.  I expect the <asp:Table> element to work in the same way as <table> because they are, for all intents and purposes, the same thing.  Am I missing something?

DropDownList within FormView Error

I have a FormView which works find and I have added a new DropDownList within the form which references another table to which I need to select a value,
I have added the dropdownlist2 and setup a new connection string to this, when I run the page I get this error:

Could not find control 'DropDownList2' in ControlParameter 'CurrencyID'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'DropDownList2' in ControlParameter 'CurrencyID'.
any help would be greatly

Reports Editing



            I opened my reports in Business Intelligent Development Studio 2005. I want to edit reports.

I m newbie to these reports. Is it the right way to Open in Business Intelligent Development Studio 2005.

How can I edit the reports after that.? Can anyone help me from beginning.


ReportViewer :: Failed to enable constraints. But my statement is valid!!

  • A
  • n error has occurred during report processing.
      • Exception has been thrown by the target of an invocation.
        • Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

    Why do I keep getting this error, even when not using any data on the report. When I run the query in SQL server I get a resultset. However when I try to render the report I get this error.


    Toolbox: Powerful Text Editing, Web Testing in .NET, Extended Unit Testing, and More


    Powerful Text Editing, Web Testing in .NET, Extended Unit Testing, and More

    James Avery

    MSDN Magazine February 2008

    Locale Hero: Enable Global Apps With Locale Builder And Windows Vista


    Everything you need to know about locales in Windows Vista.

    Kieran Snyder and Shawn Steele

    MSDN Magazine December 2006

    Agile Development: Extend Team Foundation Server To Enable Continuous Integration


    How does Visual Studio 2005 Team System and Team Foundation Server facilitate the process of agile development and continuous integration? Here Ben Waldron explains it all.

    Ben Waldron

    MSDN Magazine March 2006

    Security Briefs: Access Control List Editing in .NET


    Access control lists (ACLs) can be complex beasts, and user interfaces for editing them are incredibly tricky to implement properly. That's why I was really excited when Windows® 2000 shipped with a programmable ACL editor, shown in Figure 1.

    Keith Brown

    MSDN Magazine March 2005

    ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
    Sql Server  SharePoint  Silverlight  Others  All   

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend