troubleshooting Question

hide link button and disable

Avatar of kdeutsch
kdeutschFlag for United States of America asked on
.NET ProgrammingASP.NETVisual Basic.NET
9 Comments2 Solutions1020 ViewsLast Modified:
I am using a telerik grid so that I can use detail tables.  What i am having trouble with is getting the value of a cell and depending on that value disabling the link button on the same row.  So currently whent he grid loads nothing is changed even though a couple link buttons should be hidden, but when I click on one and it posts back all the link butons disapear.  What am I doing wrong here and why does it not work on grid load.

 Protected Sub myIssueGrid_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myIssueGrid.ItemDataBound
        If e.Item.OwnerTableView.Name = "myIssueGrid" Then
            If TypeOf e.Item Is GridDataItem Then
                Dim Item As GridDataItem = DirectCast(e.Item, GridDataItem)
                Dim lbl As TableCell = Item("strTransaction")
                Dim Trans As LinkButton = DirectCast(Item.FindControl("lnkTransfer"), LinkButton)
                Dim tType As Label = DirectCast(Item.FindControl("lbltranstype"), Label)
                Dim image As Image = DirectCast(Item.FindControl("imgReturn"), Image)
                Dim type As Integer

                Type = Convert.ToInt32(tType.Text)

                If type = 6 Or tType.Text = "TRANSFER" Then   Either one of these should work
                    Trans.Enabled = False
                    image.Visible = False
                End If
            End If
        End If
    End Sub

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros