Edit database directly with gridView ASP.NET - c#

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!

Related

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

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!

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

Telerik Rad grid Insert and Update command not firing their events

I am working on a project where Telerik Controls are used. Earlier, grid was having 2 template columns with command button column for firing edit and delete command. Clicking on edit will automatically convert the edit button to an update button, and delete becomes cancel. Everything was working fine, until now.
Later I added two more textboxes inside that grid as templated column. And made relevant changes in code where the child controls are unboxed. But, on running, I found that the events are not firing. That is, Insert and Update; cancel, edit and delete are working fine.
One more thing, on clicking page does a postback, but the event is not fired.
Any ideas based on this scenario? Might be anybody already faced such conditions.
Note: I am working on remote Terminal, so clipboard operations and Internet are blocked there. We can only connect, write, compile, and execute code there. So I can't paste here the code for help.
I got it fixed, it was weird by anyhow I got it working. Issue was in radgrid template column i added an attribute visible ="false" and that made me sick. I removed that and every thing went fine..
I was facing this problem. I was explicitly binding the grid. I took that out and used NeedDataSource function. That solved my problem.
So if any one faces this issue, verify whether you are binding the grid anywhere else in the code behind file.

Filling GridView on some Button Click in MVC

I am working on some project which is in classic ASP.NET, but I need to migarate that into MVC
Right Now I am having a page with one button and gridview which get fill on clicking the button. Gridview has the functionality like EDIT, DELETE, Paging, OnRowCommand Event.
How should I perform this page through MVC. I know gridview can't be used in MVC, so what's the alternative of that.
Thanks
Consider using a jQuery Grid plugin, like this one. I assume you have already figured out how to populate your view with data, etc.
I would recommend the Telerik MVC Grid Control. They are free and open source, and I am using these at the moment and don't have a bad thing to say about them!
http://demos.telerik.com/aspnet-mvc/grid/editingajax
Here I found the perfect answer for me
http://blog.maartenballiauw.be/post/2008/06/Code-based-ASPNET-MVC-GridView.aspx
It works good for me clearlly understandable for me, I would say #amarsuperstar example also looks fine but not looks for beginners

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