Solved

Gridview - Rowdatabound - get ID

Posted on 2011-03-01
1
1,278 Views
Last Modified: 2012-05-11
how can I get id value from Gridview in Rowdatabound event? ID column, I set visible = "false"
Gridview - datakeyname, I set it to ID.
Gridview.datakeys(e.row.rowindex)value return nothing
0
Comment
Question by:VBdotnet2005
1 Comment
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 125 total points
ID: 35011088
if ur coloum is first coloum
try to use this

in rowdatabound event

e.Row.Cells(1).Text

if u want to use datakeyes
then try like this
<asp:GridView ID="gvUsers" runat="server" AutoGenerateColumns="False"
            DataKeyNames="UserID" OnRowDataBound="gvUsers_RowDataBound"
            RowStyle-CssClass="Row" onrowcommand="gvUsers_RowCommand">
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question