| | |
Select entire row details on click of button of that row inside a GridView
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2006
Posts: 116
Reputation:
Solved Threads: 0
I am displaying a GridView on some specific criteria which is entered by some textboxes say studentid, studentname as input from textbox and show records in GridView.
For this I m using a stored procedure which returns a datatable based on inputs came from textboxes.
I want an Edit button in the Gridview on click of which a <div> with some label and textbox controls get displayed with prefilled entries.
For this I want the datarow from the datatable got from the stored procedure, from where I will get the complete info. Also I want to edit the data.
How can I get the row details of specified Edit button row and which way is better put a command button control in ItemTemplate of GridView or use a Buttonfield cotnrol inside the GridView?
I am working in ASP.NET2.0 and C#.
I m not getting the correct way, can anybody suggest me?
Thanks in advance,
For this I m using a stored procedure which returns a datatable based on inputs came from textboxes.
I want an Edit button in the Gridview on click of which a <div> with some label and textbox controls get displayed with prefilled entries.
For this I want the datarow from the datatable got from the stored procedure, from where I will get the complete info. Also I want to edit the data.
How can I get the row details of specified Edit button row and which way is better put a command button control in ItemTemplate of GridView or use a Buttonfield cotnrol inside the GridView?
I am working in ASP.NET2.0 and C#.
I m not getting the correct way, can anybody suggest me?
Thanks in advance,
you can show a "select" button and then
in the "selectedindexchanged" of the gridview show the selected row in the controls i.e text boxes and labels such
as
textbox1.text = gridview1.selectedrow.cell(0).text
remember that indexes of grid are zero based. Obviously you will have a save button on your page or form and edit the selected text as required and then click that button and do the database operation as required.
Hope this will help you. if you need a detail presentation i can send you a sample page.
in the "selectedindexchanged" of the gridview show the selected row in the controls i.e text boxes and labels such
as
textbox1.text = gridview1.selectedrow.cell(0).text
remember that indexes of grid are zero based. Obviously you will have a save button on your page or form and edit the selected text as required and then click that button and do the database operation as required.
Hope this will help you. if you need a detail presentation i can send you a sample page.
Thanks and Best of Lusk,
Farid ud din Masood
MS.c (CS)
University of Agriculture, Faisalabad
Farid ud din Masood
MS.c (CS)
University of Agriculture, Faisalabad
•
•
Join Date: Sep 2006
Posts: 116
Reputation:
Solved Threads: 0
•
•
•
•
you can show a "select" button and then
in the "selectedindexchanged" of the gridview show the selected row in the controls i.e text boxes and labels such
as
textbox1.text = gridview1.selectedrow.cell(0).text
remember that indexes of grid are zero based. Obviously you will have a save button on your page or form and edit the selected text as required and then click that button and do the database operation as required.
Hope this will help you. if you need a detail presentation i can send you a sample page.
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: Hi all
- Next Thread: Please help me
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions control css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash formatdecimal formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news novell numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





