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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 19, 2013, 9:13 PM EDT
Regards,
Iftikar
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 19, 2013, 8:40 PM EDT
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.
Ravi ShekharRank #673 · 3.6K reputationPosted Aug 19, 2013, 8:48 PM EDT
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
Rini150 reputationPosted Aug 19, 2013, 8:48 PM EDT
Parameter name: index"
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 19, 2013, 8:49 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 19, 2013, 8:50 PM EDT
Please share your code.
Regards,
Iftikar
Rini150 reputationPosted Aug 19, 2013, 8:54 PM EDT
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);
}
}
Rini150 reputationPosted Aug 19, 2013, 8:57 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 19, 2013, 8:59 PM EDT
int rowIndex = Convert.ToInt32(e.CommandArgument);
int classId = Convert.ToInt32(gv1.DataKeys[rowIndex].Value);
and also share the .aspx code
Regards,
Iftikar
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 19, 2013, 9:00 PM EDT
Regards,
Iftikar
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 19, 2013, 9:07 PM EDT
Rini150 reputationPosted Aug 19, 2013, 9:09 PM EDT
Rini150 reputationPosted Aug 19, 2013, 9:20 PM EDT