hello every one
I want to use many values from gridview on row command of gridview then what would i use.
i have been using many label in gridview to bind the values of id, name, subject etc.
for example i want to store
name and subject in session from gridview on row command then what would i use. please tell me
Loading
Jaganathan BantheswaranPosted Oct 4, 2013, 2:09 PM
Use like this on Row Command Button,
Jaganathan BantheswaranPosted Oct 17, 2013, 4:44 AM
Gopal Ji SinghPosted Oct 17, 2013, 2:54 AM
Khargesh RajputPosted Oct 4, 2013, 4:35 AM
Gopal Ji SinghPosted Oct 4, 2013, 4:30 AM
my GridView script given bellow...
BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3"
CellSpacing="1" GridLines="None" AutoGenerateColumns="False" onrowcommand="grdexam_RowCommand"
>
Jaganathan BantheswaranPosted Oct 1, 2013, 2:28 AM
Gopal Ji SinghPosted Sep 30, 2013, 6:13 AM
Then i m facing this error(Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index) please help me
Jaganathan BantheswaranPosted Sep 30, 2013, 5:46 AM
Try something like this.
protected void gridMembersList_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Add") // Or something
{
int index = Convert.ToInt32(e.CommandArgument.ToString());
Literal ltrlslno = (Literal)gridMembersList.Rows[index].FindControl("ltrlSlno");
Literal ltrlName = (Literal)gridMembersList.Rows[index].FindControl("ltrlName"); Session["ltrlName "] = ltrlName.Text;
}
}