Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspdotnet_website_programming thread: href in datagrid


Message #1 by Greg Partin <GPartin@c...> on Mon, 8 Apr 2002 09:59:12 -0400
Hi all,

I'm having trouble accessing cells in my datagrid.  I'm using the following
code:

Sub CheckLink_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs)

        If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType 
ListItemType.AlternatingItem) Then

            Dim test As String 
            test = e.Item.Cells(0).Text.ToString()

            If e.Item.Cells(0).Text.ToString() = "0" Then

                e.Item.Enabled = False

            End If

        End If

End Sub


The end result I am looking for is that cell 0 is a hyperlink that is
generated from a SQL statement.  If the value of the text is 0 then I don't
want the user to be able to click on it.  The problem I have is that when I
look at the value of test after line 5 it is equal to "".  If I let the code
run the datagrid will come out with values in the cell.  Any suggestions?
I've been battling this one for awhile!


thanks,
Greg
Message #2 by Greg Partin <GPartin@c...> on Tue, 9 Apr 2002 13:49:32 -0400
Hi all,
This is like the 3rd time I've asked this question.  Am I not describing my
problem well enough?  Is this not the correct list to send this question to?
Or is the question baffling to everyone?  Please let me know.

thanks,
Greg

-----Original Message-----
From: Greg Partin [mailto:GPartin@c...]
Sent: Monday, April 08, 2002 9:59 AM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] href in datagrid


Hi all,

I'm having trouble accessing cells in my datagrid.  I'm using the following
code:

Sub CheckLink_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs)

        If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType 
ListItemType.AlternatingItem) Then

            Dim test As String 
            test = e.Item.Cells(0).Text.ToString()

            If e.Item.Cells(0).Text.ToString() = "0" Then

                e.Item.Enabled = False

            End If

        End If

End Sub


The end result I am looking for is that cell 0 is a hyperlink that is
generated from a SQL statement.  If the value of the text is 0 then I don't
want the user to be able to click on it.  The problem I have is that when I
look at the value of test after line 5 it is equal to "".  If I let the code
run the datagrid will come out with values in the cell.  Any suggestions?
I've been battling this one for awhile!


thanks,
Greg

Message #3 by "Christopher Wylie" <cwylie@i...> on Tue, 9 Apr 2002 12:07:25 -0600
Hi Greg,

I can't help you out, but I can reference you to a reasonable .net forum
where you might get an answer:
http://www.webcontrolcenter.com/forum/

Wylie

-----Original Message-----
From: Greg Partin [mailto:GPartin@c...]
Sent: Tuesday, April 09, 2002 11:50 AM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] RE: href in datagrid


Hi all,
This is like the 3rd time I've asked this question.  Am I not describing my
problem well enough?  Is this not the correct list to send this question to?
Or is the question baffling to everyone?  Please let me know.

thanks,
Greg

-----Original Message-----
From: Greg Partin [mailto:GPartin@c...]
Sent: Monday, April 08, 2002 9:59 AM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] href in datagrid


Hi all,

I'm having trouble accessing cells in my datagrid.  I'm using the following
code:

Sub CheckLink_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs)

        If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType 
ListItemType.AlternatingItem) Then

            Dim test As String
            test = e.Item.Cells(0).Text.ToString()

            If e.Item.Cells(0).Text.ToString() = "0" Then

                e.Item.Enabled = False

            End If

        End If

End Sub


The end result I am looking for is that cell 0 is a hyperlink that is
generated from a SQL statement.  If the value of the text is 0 then I don't
want the user to be able to click on it.  The problem I have is that when I
look at the value of test after line 5 it is equal to "".  If I let the code
run the datagrid will come out with values in the cell.  Any suggestions?
I've been battling this one for awhile!


thanks,
Greg




Message #4 by Greg Partin <GPartin@c...> on Tue, 9 Apr 2002 14:23:05 -0400
Thanks Christopher, I registered and posted.  Hope for a reply!

Greg

-----Original Message-----
From: Christopher Wylie [mailto:cwylie@i...]
Sent: Tuesday, April 09, 2002 2:07 PM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] RE: href in datagrid


Hi Greg,

I can't help you out, but I can reference you to a reasonable .net forum
where you might get an answer:
http://www.webcontrolcenter.com/forum/

Wylie

-----Original Message-----
From: Greg Partin [mailto:GPartin@c...]
Sent: Tuesday, April 09, 2002 11:50 AM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] RE: href in datagrid


Hi all,
This is like the 3rd time I've asked this question.  Am I not describing my
problem well enough?  Is this not the correct list to send this question to?
Or is the question baffling to everyone?  Please let me know.

thanks,
Greg

-----Original Message-----
From: Greg Partin [mailto:GPartin@c...]
Sent: Monday, April 08, 2002 9:59 AM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] href in datagrid


Hi all,

I'm having trouble accessing cells in my datagrid.  I'm using the following
code:

Sub CheckLink_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs)

        If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType 
ListItemType.AlternatingItem) Then

            Dim test As String
            test = e.Item.Cells(0).Text.ToString()

            If e.Item.Cells(0).Text.ToString() = "0" Then

                e.Item.Enabled = False

            End If

        End If

End Sub


The end result I am looking for is that cell 0 is a hyperlink that is
generated from a SQL statement.  If the value of the text is 0 then I don't
want the user to be able to click on it.  The problem I have is that when I
look at the value of test after line 5 it is equal to "".  If I let the code
run the datagrid will come out with values in the cell.  Any suggestions?
I've been battling this one for awhile!


thanks,
Greg






  Return to Index