-
To get the Id from a Datagrid
I have some textboxes and dropdownlist where we have to enter data and then
I have a datagrid in which i have some columns like..
The first field is a Checkbox column.
for binding datagrid. i am giving the query like
select name,address,phone from table1.
Checkbox Name address Phone
and at last i have button. So when we click that button, i have to insert some values into a table Table2. The values that r inserting into Table2 are from the controls ouside the grid and One field is the ID, that i have to get from datagrid.
How to get the corresponding ID , when the checkbox is clicked???
please help me.....itx urgent
-
Change your query to include the ID for each row:
SELECT id, name, address, phone FROM table1
Add an invisible BoundColumn to your DataGrid to contain the ID:
<asp:BoundColumn DataField="ID" Visible="False" />
Now you may read the ID from the DataGrid as you would any other column.
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
at last i did like that only...i thought there will be some other solution for this...
Anyway Thanks....
Similar Threads
-
By bubberz in forum ASP.NET
Replies: 7
Last Post: 07-09-2006, 01:56 AM
-
By naijacoder in forum ASP.NET
Replies: 0
Last Post: 09-02-2005, 07:28 PM
-
By Webmaster in forum dotnet.announcements
Replies: 0
Last Post: 06-05-2003, 09:30 PM
-
By Thomas Eyde in forum .NET
Replies: 8
Last Post: 08-01-2002, 06:43 PM
-
Replies: 2
Last Post: 08-01-2002, 10:54 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks