Get the value of the primary key in the gridview (gridview1_rowcommand, gridview1_pageindexchanging, gridview1_rowdeleting .....)

Source: Internet
Author: User

InObtain the value of the primary key in gridview1_rowcommand:

Protected void gridview1_rowcommand (Object sender, gridviewcommandeventargsE)
{
Int orderid = convert. toint32 (gridview1.datakeys [convert. toint32 (E. commandargument)]. value );}

InObtain the value of the primary key in gridview1_pageindexchanging

Protected void gridview1_pageindexchanging (Object sender, gridviewpageeventargs E)
{
Int Index = gridview1.datakeys [E. newpageindex]. value;
}

InObtain the value of the primary key in gridview1_rowdeleting
Protected void gridview1_rowdeleting (Object sender, gridviewdeleteeventargs E)
{
Int Index = gridview1.datakeys [E. rowindex]. value;
}

InObtain the value of the primary key in gridview1_rowediting
Protected void gridviewinclurowediting (Object sender, gridviewediteventargs E)
{
Int Index = gridview1.datakeys [E. neweditindex]. value;
}

InObtain the value of the primary key in gridview1_rowupdating.

Protected void gridview1_rowupdating (Object sender, gridviewupdateeventargs E)
{
Int Index = gridview1.datakeys [E. rowindex]. value;
}

InObtain the value of the primary key in gridview1_rowdatabound.
Protected void gridview1_rowdatabound (Object sender, gridviewroweventargs E)
{
Int Index = gridview1.datakeys [E. Row. rowindex]. value;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.