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.
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...
By bubberz in forum ASP.NET
Last Post: 07-09-2006, 01:56 AM
By naijacoder in forum ASP.NET
Last Post: 09-02-2005, 07:28 PM
By Webmaster in forum dotnet.announcements
Last Post: 06-05-2003, 09:30 PM
By Thomas Eyde in forum .NET
Last Post: 08-01-2002, 06:43 PM
Last Post: 08-01-2002, 10:54 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center