Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Is there a way to write out values of each row in gridview into seperate labels?

example:

say i have a gridview with 5 rows. is there a way to write out valuesof each checked row into seperate labels?

Gridview has 5 rows, and 2 columns name and number
say i check row 1,3,5 on gridview with thier checkbox and click a button.
not it would look like this below the gridview.

label1: row1 Name
label2: row2 Number

label3: row3 Name
Label4: row3 Number

Label5: row5 name
Label6: row5 Number

I dont want to use autopostback when checking the checkbox, i want to check row 1,3,5 then click the button to show the values in each label.
Posted
Comments
Jephunneh Malazarte 18-Oct-12 22:51pm    
are you using template or boundfield?
PTG.Jake 19-Oct-12 8:28am    
The checkbox on the grid is in a template field, and the 2 columns are bound fields.

1 solution

You can get the value of the Row using
RowIndex 
property of GridView. Then retrieve the Text of the Column for the selected
RowIndex 
and Print it on the Label. and for Not postback use UpdatePanel.


Thanks
 
Share this answer
 
v2

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