Site Search:
Sign in | Join | Help
4Penny.net

ComponentArt

ComponentArt itemContentCreated and itemDataBound

I have been using itemDataBound to hook up things in CA grids, but their docs say to use itemContentCreated. I'm sure there is not much difference.  This event will fire seperately for each template column in the row.

Code Sample:  

 Protected Sub grdHolds_ItemContentCreated(ByVal sender As Object, ByVal e As ComponentArt.Web.UI.GridItemContentCreatedEventArgs) Handles grdHolds.ItemContentCreated

        'as the grid binds, see if the user has access to edit this type of data
        'show the 'edit' link if they have access
        Dim strHoldType As String
        Dim bShow As Boolean = False

        strHoldType = e.Item("vchrHoldType")

        'disable the link if the edit page doesnt exist
        If strHoldType = "PRICING" Or strHoldType = "MORTAR" Then
            bShow = False
        End If

        Dim lbtnEdit As New LinkButton
        lbtnEdit = e.Content.FindControl("lbtnEdit")

        lbtnEdit.Visible = bShow
    End Sub

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add

About Steve Gray

Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.