Getting column data from GridView on page using MasterPage
-
Nah, the Masterpage has nothing to do with this... just convert all your columns to templates (note that they will all default to Label controls; let me know if you need help with templated fields), then give your templated controls meaningful names. THEN you can access them like this: String _city; ... protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { ... Label city = (Label)(GridView1.SelectedRow.FindControl("cityLabel")); _city = city.Text; city.Dispose(); //yup, always clean up! TextBox copy = (TextBox)(GridView1.SelectedRow.FindControl("copyTextBox")); copy.Text = _city copy.Dispose(); } Give this a try. Let me know if it works ro not :-)
Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea
Mate I Loves Ya! That works perfectly!!! Thanks a lot. But perhaps you can tell me 1 thing? Why does it only work when passing the Controls Data to a variable and then onto the static label control, yet it doesnt work when i miss out the middle man and try getting the data from the dynamic label and adding it straight to the static label? Thanks again. I appreciate your time!
-
Mate I Loves Ya! That works perfectly!!! Thanks a lot. But perhaps you can tell me 1 thing? Why does it only work when passing the Controls Data to a variable and then onto the static label control, yet it doesnt work when i miss out the middle man and try getting the data from the dynamic label and adding it straight to the static label? Thanks again. I appreciate your time!
Oh I have no idea why... typically when something doesn't work, I find a work around and move-on. Im sure the 'corky' .Net has its reasons, I just don't have time/patience to figure out the WHY ;-) Now, what does Mate I Loves Ya! mean??
Nila "...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
-
Oh I have no idea why... typically when something doesn't work, I find a work around and move-on. Im sure the 'corky' .Net has its reasons, I just don't have time/patience to figure out the WHY ;-) Now, what does Mate I Loves Ya! mean??
Nila "...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
Grapes-R-Fun wrote:
Now, what does Mate I Loves Ya! mean??
Ive no idea. Its a work around i use on my Girlfriend for most situations
Babe, i love you!
Likewise i dont understand women or what they want. lol!! :confused::laugh: -
Grapes-R-Fun wrote:
Now, what does Mate I Loves Ya! mean??
Ive no idea. Its a work around i use on my Girlfriend for most situations
Babe, i love you!
Likewise i dont understand women or what they want. lol!! :confused::laugh:LOL- are u flirting with me? :-O
Nila "...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
-
LOL- are u flirting with me? :-O
Nila "...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
Grapes-R-Fun wrote:
are u flirting with me?
I wasnt until i saw your pic on your profile!:->
-
Grapes-R-Fun wrote:
are u flirting with me?
I wasnt until i saw your pic on your profile!:->
um, how did you see my pic? do you have one??;)
Nila "...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
-
um, how did you see my pic? do you have one??;)
Nila "...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
Your profile!
-
Your profile!
oh yeah, I figured how to see others' profiles as well... I am queen of the clueless nation!! why don't you put your pic up?
Nila "...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
-
oh yeah, I figured how to see others' profiles as well... I am queen of the clueless nation!! why don't you put your pic up?
Nila "...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
Grapes-R-Fun wrote:
why don't you put your pic up?
Are you flirting with me?
-
Grapes-R-Fun wrote:
why don't you put your pic up?
Are you flirting with me?
lol, maybe!
Nila I do ANYTHING for an extra large cup of coffee!