Click here to Skip to main content
15,902,447 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When clicking on a button, how can i display the details of the selected checkbox (in a gridview) in a new page..

CHECKBOX FIRSTNAME  MIDDLENAME  LASTNAME  GENDER  COUNTRY
[]            fah                       s                d             M         India

DISPLAY(Button)

If i click this display button i need to view the selected checkbox in new page..
Posted
Updated 23-Nov-11 23:25pm
v2
Comments
Dylan Morley 24-Nov-11 5:25am    
Removed shouting from title, it was hurting my eyes

Try to see these links,

adding-a-gridview-column-of-checkboxes-cs
CheckBox in GridView

see first link and use as

Session["value"]=row.Cells[1].Controls[0].Text;


//use session management to view data on other pages
Controls[0] will be your check box
 
Share this answer
 
v2
Comments
ythisbug 24-Nov-11 4:49am    
actually i need to display selected checkbox in another page..how to do dat.
thatraja 24-Nov-11 4:49am    
:D :D :D :D
You first link redirects to this page
uspatel 24-Nov-11 6:23am    
thanks for this...
ythisbug 24-Nov-11 4:54am    
i dint get thatraja??
ythisbug 24-Nov-11 5:01am    
please give me solution for that question?
I assume your button is out side the grid view and only one check box can check in the grid view at once.

if so inside the button click event. you need to loop the grid view for find the checked item.

C#
foreach (DataRow dr  in DetailsView1.Rows)
            {

            }



then there is 2 ways to display in other page.
1) take all row data in to current session and the on the next page show those data.(ex: to string[] and then put in to the session)

2) take only id of checked item and put in to the query string or session and then retrieve on next page. using that id you can retrieve data belongs to particular id and display where ever you want.

hope this will help...

if you need more code level help please noted...
 
Share this answer
 

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