T
Timothy H. Schilbach
Hi Everyoine,
I am populating a DetailsView with a record from a user and everything
runs fine. What I want to do on the databinding is to go through each row
and make sure there is data beign displayed. Now I have setup the following
routine to do just that:
Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DetailsView1.DataBound
Dim row As DetailsViewRow
For Each row In DetailsView1.Rows
If String.IsNullOrEmpty(row.Cells(1).Text) Then
row.Visible = False
End If
Next
End SubWhen I run my code I get the dreaded: Specified argument was out
of the range of valid values.Parameter name: index When I change the cells
to: row.Cells(0) it runs fine. Now obviously there is a Cell(0) and Cell(1)
as you can see my results below. What is happening that I cannot access
Cells(1)? Any help is greatly appreciated.Cn uName DistinguishedName
CN=UserName,OU=Email,DC=nowhere,DC=local DisplayName Timothy Schilbach
GivenName User Sn Name Mail (e-mail address removed) alias1
(e-mail address removed) alias2 alias3 alias4 alias5
I am populating a DetailsView with a record from a user and everything
runs fine. What I want to do on the databinding is to go through each row
and make sure there is data beign displayed. Now I have setup the following
routine to do just that:
Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DetailsView1.DataBound
Dim row As DetailsViewRow
For Each row In DetailsView1.Rows
If String.IsNullOrEmpty(row.Cells(1).Text) Then
row.Visible = False
End If
Next
End SubWhen I run my code I get the dreaded: Specified argument was out
of the range of valid values.Parameter name: index When I change the cells
to: row.Cells(0) it runs fine. Now obviously there is a Cell(0) and Cell(1)
as you can see my results below. What is happening that I cannot access
Cells(1)? Any help is greatly appreciated.Cn uName DistinguishedName
CN=UserName,OU=Email,DC=nowhere,DC=local DisplayName Timothy Schilbach
GivenName User Sn Name Mail (e-mail address removed) alias1
(e-mail address removed) alias2 alias3 alias4 alias5