Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
How we can select rows value in gridview on row command function ?

Please help me.

Thanks in Advance..
Posted
Updated 24-May-11 2:56am
v2

We usually use the Command Argument property of the row command to hold the index of row, then utilize it for retrieving the row information.

Click here for more details about GridViewCommandEventArgs
 
Share this answer
 
v2
Hope this[^] might help you.
 
Share this answer
 
You can set the rowindex throug command argument as
XML
CommandArgument='<%#Eval((GridViewRow)Container.RowIndex))%>'

From Code behind,
int index=convert.toint32(e.commandargument.tostring());
label lbl=(label)gridview1.rows[index].findcontrol("Labelnam");
string name=lbl.text;
 
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