Click here to Skip to main content
15,300,338 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
There is Dropdownlist say: ddlSelectionMenu

[The dropdown contains the list of all tables in database]

There is a Button say : Submit

[On Clicking this button particular selected table should be populated in Gridview]

There is only single Gridview say : gvShowTables

[The gridview must be able to have functionality for Edit, Update, Delete, Cancel]

However, the Edit, Update operations should happen at Mouse Click Event / Mouse Double Click Event.

The functionality would be similer to what is there at:[^]

Please Help...send the code to [email removed]

Thanks in advance.
Updated 25-May-12 10:35am
RDBurmon 25-May-12 8:01am
Let us know what you have tried.
Adwaitam 28-May-12 4:29am
I have created a gridview which performs Create, Edit, Delete and Update operations on row using templatefield. I also implemented double click editing in javascript. Now what I want is that:
My gridview should be editable i.e. rows should be editable even if it binds to different tables in database with different columns.
i.e. <asp:templatefield> doesn't contain specific set of code for particular table or particular columns.
Wendelius 25-May-12 16:36pm
No need to reveal your email, you'll get notified automatically when someone answers.
Adwaitam 28-May-12 4:30am
thanx for notifying it...I will keep in mind hereafter.

1 solution

Start from here,
GridView all in one[^]
Inplace Edit in GridView[^]
Editable GridView in ASP.NET 2.0[^]

Try out, if you get stuck, post specific issue.
Adwaitam 28-May-12 4:34am
Hey Sandeep,
Thank You for your reply...but I want my gridview should be able to bind to multiple tables in the database...and also need to be editable row-wise.
Sandeep Mewara 28-May-12 4:43am
A grid can bind to ONE table at a time. Form a query such that multiple table results are collated and results into a single DataTable that can be used to bind with Grid.

Editable row wise is already explained in above links.
Adwaitam 28-May-12 4:57am
but even if we bind a datatable to gridview, is it possible to edit the columns in the gridview (which will be with respect to the different columns of various tables)?

Let Us Assume---

There is Single GridView
Initially, I bind say Emp_Address Table to the GridView so I should have Street Name, Area, City Fields editable, updatable etc.
But when I will attach say Emp_Contact Details Table, I should have Phone No, Mobile No, Email ID Columns editable in same gridview.

So, What do we need to do to achieve this scenario?
Please Suggest....

Thank You.

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