ASP.NET Edit Gridview Row data and update changes in database - c#

I have an ASP.NET Web Forms project to make and I have a Staff Page that has a Gridview which is populated from the database and I want to enable "Edit Mode" by clicking Edit button which is on each row and then Save the changes into the database by making an UPDATE statement. Which would be the best approach to do this. I am still a junior so please be very generous with details and explanation. Thank you in advance!

Related

ASP.NET WebForms, DropDowns, Submit Button

I have struggled to find a solution to this problem through lots of Google searching and documentation reading, and even looking at others’ source code, but I am putting it here in the hopes that someone knows how to help me or has specific experience in dealing with such a thing.
I am currently working on an ASP.NET WebForms project with some of my colleagues, and we have decided to go with an option of which I was not a fan. We have created a page where the user will be required to fill out the university classes they have taken, with related data, in a massive sheet of dropdown menus.
These dropdown menus are pulling their associated data for the user to choose from the database (SQL Server, a.k.a. “Microsoft SQL”), as a way to partially limit user error. The user will make their selections on none, one, some, or multiple dropdowns from multiple “rows” on this page.
My question is how I can write an SQL Server query, and thus, stored procedure, that will allow for a “submit” or “save changes” button to be added to this page. When a user clicks this button, presumably, all of the changes that they have made on any of these “rows” – one row per class – will be added to the database for their respective user account.
My suggestion was having that page be an ASP.NET Grid View that would update with the classes that the user had taken as they entered them. There would be a button at the top of the page where the user could click “Add Class”, and they would be taken to a model popup or some other page, and they would enter the details of that class, mostly through predefined information that is pulled from the database. In the case of an administrator user, they would essentially be able to put whatever information in for the class, because they have the ability to override the strictly regulated format for regular (student) users.

Edit database directly with gridView ASP.NET

We're having problems with editing a database with a gridView. I've been looking around and I've seen that there are some options in the properties to put an edit link next to the gridView. I've also seen the sqlDataSource Control, which seems to be a little too complicated for me. A user needs to be able to see the database content in the gridView, then be able to edit the content and clicking submit which updates the database with the changed content.
Is there any simple way to do this?
If not, any other suggestions?
Thanks in advance!

In Asp.net MVC 4 multiple inline row update in single click using WebGrid

I wants to do multiple inline rows update when click on Update button outside the Grid.
Below is the url of sample project I am referring.
http://www.c-sharpcorner.com/UploadFile/cd7c2e/create-an-editable-webgrid-in-mvc4-to-implement-crud-operati/
But in this sample the admin is updating each row by row. But I want all rows to be updated using update button outside the grid, so that users of my application can click on that update button after they complete editing of the entire grid.
Please help me if anyone knows how to achieve this. Also let me know if you wants any more information. The details of the application and the source code you can get from the above link.
Note :- I am using here WebGrid in ASP.MVC 4, if you know any other free grid that can be used in this scenario, please let me know.
Thanks a lot

Inserting multiple records with one click in Telerik mvc grid

I am working on a Telerik MVC grid. My requirement is to allow a user to insert multiple records into the grid. This should be done on the client side.
After entering several records in the grid, the user will click a button so that all the records are inserted into the database.
Is this possible with Telerik MVC grid?
Thanks in advance.
Here is a guide for doing a batch update from Telerik themselves: http://www.telerik.com/help/aspnet-ajax/grdperformingbatchupdates.html
Here is a demo using automatic operations to allow multi-row editing: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx
Here is another ticket which links to a demo from Telerik doing this type of thing: http://www.telerik.com/community/forums/aspnet-ajax/grid/339723-batch-insert.aspx
Bottom line: it can be done, but it isn't super easy and will require quite a bit of custom code. More than I am able to share here, but the above links (especially the last one) should provide you the resources you need.
Not supported out-of-the-box from the Telerik MVC grid extensions AFAIK, but it should be possible by making jQuery ajax or web service calls which add items in the source and bind the grid. And I recently heard that they crafted batch client edits/updates for the Q1 2011 release, due in mid March.
The latest release of Telerik MVC Grid supports what's called batch editing directly. Here is the documentation on how to use the new feature.

How to add/edit functionality in the same page without flickering?

My current asp.net(c#) project required add/edit functionality in the same page without flickering.
To fill the textbox,fileuploader & dropdown list etc while updating the contents.
I searched google,but fileuploader not working properly in the ajax update panel
Please give examples/reference for solving the problem.
The following links will help you.
http://www.ajaxlines.com/ajax/stuff/article/using_jquery_to_directly_call_aspnet_ajax_page_methods.php
http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/

Categories