Click here to Skip to main content
Click here to Skip to main content

How to get Hidden Column Value in GridView

By , 18 Jun 2010
 
Alternative way for 1B, this one is way faster :) :
 
        protected void btnSelect_Click(object sender, EventArgs e)
        {
 
            Button btn = (Button)sender;
            DataControlFieldCell dfc = (DataControlFieldCell)btn.Parent;
            GridViewRow gvr = (GridViewRow)dfc.Parent;
            Label lblAddressId = (Label) gvr.FindControl("lblAddressId");
 
            int iAddressId = (int)  lblAddressId.Text;
            lstAddressId.Add(iAddressId);
 
        }

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

wouter vegter
Unknown
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralHi Is there any possibility to get item template information...memberMember 445197619 Jan '12 - 8:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 18 Jun 2010
Article Copyright 2010 by wouter vegter
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid