DataGrid

J

John Smith

Any ideas why I wouldn't be able to return data from a cell within a
datagrid?

I am trying to get the value of a Cell within each Record by using

dgrProduction.Items(i).Cells(2).Text

But the text returns as '' eventhough the DataGrid shows the cells having a
value. As soon as I get this to work (which it has for me within other
applications), I was use the certain value returned to apply formatting to
the DataGrid. This page is a UserControl. Could that potentially be the
problem?

Sample Code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

...<Populate DataGrid>...

If dgrProduction.Items.Count > 0 Then

Response.Write("DataGrid1.Items.Count: " & DataGrid1.Items.Count &
"<BR>" & vbCrLf)

Dim i As Integer

For i = 0 To (DataGrid1.Items.Count - 1)
Response.Write("Value: '" & DataGrid1.Items(i).Cells(5).Text &
"'</B><BR>" & vbCrLf)
Next

End If

End Sub
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top