riw command event
what is row command event in grid view and explain it?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Aug 20, 2013, 1:13 AM
Regards,
Iftikar
RiniPosted Aug 20, 2013, 1:20 AM
RiniPosted Aug 20, 2013, 1:09 AM
Sanjeeb LenkaPosted Aug 20, 2013, 1:07 AM
Iftikar HussainPosted Aug 20, 2013, 1:00 AM
Regards,
Iftikar
Iftikar HussainPosted Aug 20, 2013, 12:59 AM
int rowIndex = Convert.ToInt32(e.CommandArgument);
int classId = Convert.ToInt32(gv1.DataKeys[rowIndex].Value);
and also share the .aspx code
Regards,
Iftikar
RiniPosted Aug 20, 2013, 12:57 AM
RiniPosted Aug 20, 2013, 12:54 AM
public void viewdetails(decimal a)
{
ClassInfo infoclass = new ClassInfo();
ClassSp spclass = new ClassSp();
infoclass = spclass.classView(a);
txt1.Text = infoclass.className;
txt2.Text = infoclass.noOfSeats.ToString();
MultiView1.SetActiveView(View2);
}
protected void gv1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "view")
{
//txt1.Text = Convert.ToString(e.CommandArgument)
int rowIndex = Convert.ToInt32(e.CommandArgument);
int classId = Convert.ToInt32(gv1.DataKeys[rowIndex].Value);
ViewState["classId"] = classId;
decimal decval = decimal.Parse(ViewState["classId"].ToString());
viewdetails(decval);
}
}
Iftikar HussainPosted Aug 20, 2013, 12:50 AM
Please share your code.
Regards,
Iftikar
Sanjeeb LenkaPosted Aug 20, 2013, 12:49 AM
RiniPosted Aug 20, 2013, 12:48 AM
Parameter name: index"
Ravi ShekharPosted Aug 20, 2013, 12:48 AM
just declare 'abc' as Commandname and find this on Rowcommand...
Now start coding!
check out below link....
In below example all operation done in RowCommand!!
http://www.aspdotnet-suresh.com/2011/02/normal-0-false-false-false-en-us-x-none.html
Sanjeeb LenkaPosted Aug 20, 2013, 12:40 AM
refer to this link.
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowcommand.aspx
read the article from Remark . you will definitely get a clear idea. if any doubt reply.