Mar
8
Written by:
Steve Gray
3/8/2011 4:36 PM
ItemDataBound is raised when individual GridItems (rows) are bound to the DataSource, giving you a chance to modify them before they're sent to the client Grid object.
ItemContentCreated is raised whenever a DataCell server template instance is generated, allowing you to customize them one at a time.
itemContentCreated Code Sample:
Code Snippet
- 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
As always, I welcome your comments!