what is GridViewRow row = this.GridView1.Rows[Convert.ToInt16(e.CommandArgument)]; ?

Last post 10-20-2008 12:28 PM by vinz. 3 replies.

Sort Posts:

  • what is GridViewRow row = this.GridView1.Rows[Convert.ToInt16(e.CommandArgument)]; ?

    10-20-2008, 9:59 AM
    • Member
      point Member
    • alvine
    • Member since 09-30-2008, 12:56 PM
    • Posts 25

    i do not understand this code can some one explain it to me ? thanks

    if (e.CommandName.ToString().Equals("AddToCart"))

    {

    this.Label1.Text = e.CommandArgument.ToString();

    GridViewRow row = this.GridView1.Rows[Convert.ToInt16(e.CommandArgument)];

  • Re: what is GridViewRow row = this.GridView1.Rows[Convert.ToInt16(e.CommandArgument)]; ?

    10-20-2008, 10:04 AM
    • All-Star
      91,768 point All-Star
    • vinz
    • Member since 10-05-2007, 11:47 AM
    • Cebu, Philippines
    • Posts 13,769
    • TrustedFriends-MVPs

    Gets the current Row when a user clicks on the AddToCart button in the Grid..

    "Code,Beer and Music ~ my way of being a programmer"

  • Re: what is GridViewRow row = this.GridView1.Rows[Convert.ToInt16(e.CommandArgument)]; ?

    10-20-2008, 11:21 AM
    • Member
      point Member
    • alvine
    • Member since 09-30-2008, 12:56 PM
    • Posts 25

    ok... what means by e.CommandArgument.ToString();

    and this.GridView1.Rows[Convert.ToInt16(e.CommandArgument)]; ???

    please give more details explaination.. thanks

  • Re: what is GridViewRow row = this.GridView1.Rows[Convert.ToInt16(e.CommandArgument)]; ?

    10-20-2008, 12:28 PM
    • All-Star
      91,768 point All-Star
    • vinz
    • Member since 10-05-2007, 11:47 AM
    • Cebu, Philippines
    • Posts 13,769
    • TrustedFriends-MVPs

    alvine :

    ok... what means by e.CommandArgument.ToString();


    and this.GridView1.Rows[Convert.ToInt16(e.CommandArgument)]; ???

     

    You can find a detail information  at the following link below:

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.commandeventargs.commandargument.aspx

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowcommand.aspx

    "Code,Beer and Music ~ my way of being a programmer"

Page 1 of 1 (4 items)