473,326 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

finding a value in a gridview row after a checkbox changes

Hi all,

I have code that used to work but no longer does when trying to
obtain the value of a field in a gridview. I do try to find the value of
a field when a checkbox in the same row handles the checkedchanged event:
that is:

Public Sub chk_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)

Dim chk As CheckBox = CType(sender, CheckBox)

Dim objItem As GridViewRow = CType(chk.Parent.Parent, GridViewRow)

Dim iIndx As Integer = objItem.RowIndex

Dim sValue As String = GridView1.Rows(iIndx).Cells(3).Text

I used to find the text for that value at the referenced Row/Cell, but

is now returning empty. I validated that the GridView.Rows.Count has

more than 0 rows, and that the index that I have is valid. Also, there is
data in the cell.

Can somewon help?

Thanks,

Carlos.
Nov 11 '08 #1
0 1818

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: postings | last post by:
Hi I have problems with autopostback and the gridview control. Please continue reading. The code below turns a row red when a tickbox is ticked in edititemtemplate. Note autopostback on the...
1
by: keithb | last post by:
How can I relate data in the bound columns of a GridView control to an unbound checkbox in a template column in the same row? The checkboxes indicate which rows are to be deleted when an update...
9
by: hazz | last post by:
I want to display 'n' records for a table-driven data entry page. The first column should be readonly and the 2nd column, a checkbox WRITABLE (NOT READONLY). I can't use the gridview because it...
0
by: landesjoe | last post by:
Hi, here's my problem in short: Text boxes in gridview don't seem to hold their value if the column's .Visible property is changed back and forth. I've got a form with a gridview populated from...
2
by: BenCoo | last post by:
Hello, In a gridview I've a checkbox (indicating a flag that is set or not). I fill the gridview via the wizard from ADO.NET 2.0 that generates automaticly the Insert, Update and Delete...
2
by: Kirk | last post by:
I have a GridView that displays several columns, one of which is a checkbox field. This is populated at runtime from a SqlDataSource and is not enabled (the user can't change it's value). I have...
4
by: Randy Smith | last post by:
Hi, I would like to limit my user selection to only one row in the GridView at a time. Is there any way to set this? TIA, Randy
1
Frinavale
by: Frinavale | last post by:
I'm working on an ASP.NET application using VB.NET for server side code. I have a GridView listing a bunch of stuff. Above the GridView I have a checkbox named "ChkBx_SelectAll". If this...
3
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
I have a gridview that has a label field and a checkbox field in it. I have the checkbox set to autopost when changed. How can I get the datakey value that is assigned to that row when a checkbox...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.