Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

How to edit GridView data without using FormView or DetailsView

I need to rewrite an asp.net 1.1 page to asp.net 4.0.
The old page contains a gridview with an area to edit each row of data.
The updates are being done like this (instead of within the grid) because there are too many fields to fit in the datagrid.
The technique used is here: http://www.dotnetjohn.com/articles.aspx?articleid=83 

The new version needs the same functionality.  That is,  a user will fill in fields, click an add button.  that record is then added to a gridview.  That same record can then be edited or deleted.
I don't want to use FormView or Detailsview because there are too many fields that have dependencies on each other.  Example: the selection of a ddl might be dependent on what was selected on a prior ddl. (it is my understanding that FormView and DetailsView become cumbersome to work with when there are such depencies on binding data)

Can anyone offer up suggestions or sample code for implementing this basic screen that has an editing area along with a gridview (without using FormView or DetailsView?)  

 
0
ToolTimeGang
Asked:
ToolTimeGang
  • 4
  • 2
  • 2
  • +1
1 Solution
 
TeggertCommented:
You might consider using the GridView footer template for your add fields and a custom onclick event to add the item to the gridview dataset/source and refresh the databind.

After that, editing in-line is simple using a standard GridView EditItemTemplate.
0
 
Ramkisan JagtapLead DeveloperCommented:
u can use ajax modalpopupextender for this.
0
Technology Partners: 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!

 
ToolTimeGangAuthor Commented:
Thank you.  
Please understand that I do not want to edit from within the gridview.  It kind of looks like the Ajax modalpopupextender might be my best bet.  Its just that I'm not sure how weill that will work knowing that there are a number of fields that are filled based on the selection of a prior field.  Perhaps I should explore the Ajax CascadingDropDown control.
0
 
Ramkisan JagtapLead DeveloperCommented:
there is no any problem using modalpopup. If fields count increase u can apply scroll to it.
0
 
ToolTimeGangAuthor Commented:
I am a newbie with AJAX controls, so can you help me understand better how using the modalpopup would work better than just including the fields on the same page as the grid?
The 1.1 version contains
- an area of shared information for all the rows of data in the datagrid (record "header" info)
- datagrid of records (record "details" info)

When the user clicks "save", the header and details are all saved at one time.  Its an all or nothing kind of save.  (The user can't just save one detail at a time)

but a user can select a datagrid row and edit the details.  This is the part that you are saying can be done using the modalpopup.  But I am wondering what the advantage of doing that is?    right now, I am saving the data in Viewstate (datatable) and repopulating the datagrid when the user saves the detail.  Thank you for helping me understand!
0
 
TeggertCommented:
Modals are coded in almost the same exact way as doing it in the page. Just rather than having the fields always display on the page, you can make them pop over the current content.

The benefit is almost purely one of visual appeal. It also allows you to dynamically change fields and such before opening the modal, so transitions aren't as apparent to the user.

Check out the example here:
http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/modalpopup/modalpopup.aspx
0
 
ToolTimeGangAuthor Commented:
I have decided to keep the fields on the same page as the gridview insetad of doing the popup.  Its best to have the user see it this way.

thanks everyone for your help.
0
 
ToolTimeGangAuthor Commented:
no comemnt
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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