Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Datagrid Control (http://www.velocityreviews.com/forums/f60-asp-net-datagrid-control.html)
-   -   HyperLinkColumn Link Value at ItemCreated (http://www.velocityreviews.com/forums/t760922-hyperlinkcolumn-link-value-at-itemcreated.html)

Dude 08-04-2004 03:47 PM

HyperLinkColumn Link Value at ItemCreated
 
I would like to format the url based on its value. How do I get the
value in my ItemCreated handler?

Sub DataGridItemCreatedHandler(ByVal sender As Object, ByVal e As
DataGridItemEventArgs)
Select Case e.Item.ItemType
Case ListItemType.AlternatingItem, ListItemType.Item 'Check the
Row Type
If (url for this row) = xxx Then
Dim hl As HyperLinkColumn = CType(dgMain.Columns(2),
HyperLinkColumn)
hl.DataNavigateUrlFormatString = ""
End If
End Select
End Sub

Thomas Dodds 08-04-2004 06:28 PM

Re: HyperLinkColumn Link Value at ItemCreated
 
I did this -- this morning!

Private Sub dgResults_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgResults.ItemCreated
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType =
ListItemType.Item Then
Dim hlCol1 As HyperLinkColumn = CType(dgResults.Columns(1),
HyperLinkColumn)
Dim hlCol2 As HyperLinkColumn = CType(dgResults.Columns(3),
HyperLinkColumn)

hlCol1.DataNavigateUrlFormatString = "javascript:doSelectPopup({0},"
& intContID & ");"
hlCol2.DataNavigateUrlFormatString = "javascript:doViewPopup({0}," &
intContID & ");"
End If
End Sub

I wanted to call a javascript using a databound param and a class scope var
param ... it works ...


"Dude" <hooterbite@yahoo.com> wrote in message
news:5aa4a0a4.0408040747.dcb3adf@posting.google.co m...
> I would like to format the url based on its value. How do I get the
> value in my ItemCreated handler?
>
> Sub DataGridItemCreatedHandler(ByVal sender As Object, ByVal e As
> DataGridItemEventArgs)
> Select Case e.Item.ItemType
> Case ListItemType.AlternatingItem, ListItemType.Item 'Check the
> Row Type
> If (url for this row) = xxx Then
> Dim hl As HyperLinkColumn = CType(dgMain.Columns(2),
> HyperLinkColumn)
> hl.DataNavigateUrlFormatString = ""
> End If
> End Select
> End Sub





All times are GMT. The time now is 02:07 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.