|
-
Dec 10th, 2008, 02:30 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Get data for selected value in gridview
Hi all,
I wonder whether I can get the selected data in gridview without using index? Like GridView1.Rows(0).Cells("Name").Text instead of Cells(0).Text bcause who will know which column is at which index right?
I have total 6 columns in my gridview. (one of them is "Select" column from gridview features and one of them is my DB bind field, "ID" which is in hidden state)
So, when I try to retrieve the selected row's ID, I got nothing. it returns nothing for this "ID" column. I use .Cells(int index).Text to get the value. (I try index 0 to 6, still no ID value) but when i changed this ID column to visible, i can access it using int index position. strange!!!
And I try to find whether there is a way to get the value by using column name but i found nothing. (I try to search this forum too, but it reply me a lot of pages and i try to read generally on some pages but still found nothing.)
So, please anyone guide me or give me some hints or some links for references.
Thanks. Thanks
Last edited by scsfdev; Dec 10th, 2008 at 02:35 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|