Click here to Skip to main content
16,022,301 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Dears,

I am stuck in the middle of my project due to this. Actually i have a SQL table and i want my C# code to dynamically load into gridview. This i have done using a simple select query. SO now i want to make the gridview is editable. Every time my table name changes as per user selection, so i am not looking for any manual activities with the help of Sqldatasource.

I want a proper way to make my Gridview editable.

Please suggest me something.

What I have tried:

Till now i can able to bind my sql table in gridview, I can see all the values in bound column. Want an edit option in front of all the rows and make the rows editable.
Posted
Updated 2-Aug-18 2:35am

1 solution

As you are referring to a "gridview" I'm assuming you are using ASP.NET.

The GridView has an edit option built in - see the documentation GridView Examples for ASP.NET 2.0: Editing the Underlying Data in a GridView[^]
 
Share this answer
 
Comments
Member 13858616 2-Aug-18 9:30am    
Yae.. but in this example the datasource and all should give manually, but in my case table names and all these things are reading dynamically. So is there is any other way rather than this?
CHill60 2-Aug-18 10:27am    
I'm not sure what you mean by "the datasource and all should give manually" but if you are saying that the contents of your datasource are determined dynamically I still don't see what the problem is - if you can bind the data in your datasource to the GridView then you can create the Update sql as well

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900