GridView Select Row By DataKey

J

JeffBuzz

I have searched high and low and cannot figure this out. I want
programmatically select a row in my GridView based on a primary key
value (DataKey). You would think this is common, but I guess not. It
is easy to do when the data key is on the current page, but doesn't
work when the key is on another page.

Any ideas?

Thanks,
Jeff
 
M

Michael Nemtsev [MVP]

Hello JeffBuzz,

What does "when the key is on another page" mean?

You can put your key inti the the grid and make that column hidden

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


J> I have searched high and low and cannot figure this out. I want
J> programmatically select a row in my GridView based on a primary key
J> value (DataKey). You would think this is common, but I guess not. It
J> is easy to do when the data key is on the current page, but doesn't
J> work when the key is on another page.
J>
J> Any ideas?
J>
J> Thanks,
J> Jef
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top