image on a datagrid

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom

    #1

    image on a datagrid

    Hey all,
    have a dategrd and am storing a url to an image in it. I
    have no idea how to show the actual image. Can anyone give
    me a hand or point me towards an example they know of. I
    have searched the web and haven't found anything that is
    of much use. Cheers and have a good one,
    Tom
  • tom

    #2
    image on a datagrid

    figured it out myself if anyone is interested:

    Private Sub dgName_ItemData Bound(ByVal sender As
    Object, ByVal e As
    System.Web.UI.W ebControls.Data GridItemEventAr gs) Handles
    dgName.ItemData Bound
    'will be used to set the value of the image in the
    datagrid
    Dim imgTest As New System.Web.UI.W ebControls.Imag e
    ()

    If e.Item.ItemType = ListItemType.It em _
    Or e.Item.ItemType = ListItemType.Al ternatingItem
    Then
    'we have hard coded the text "No image
    available" earlier on. And look for it here.
    'if that is the text then out put it, if not,
    out put the picture
    imgTest.ImageUr l = e.Item.Cells(5) .Text
    If imgTest.ImageUr l = "No image available" Then
    e.Item.Cells(5) .Text() = imgTest.ImageUr l
    Else
    e.Item.Cells(5) .Controls.Add(i mgTest)
    End If
    End If
    End Sub

    thanks anyway,
    tom[color=blue]
    >-----Original Message-----
    >Hey all,
    >have a dategrd and am storing a url to an image in it. I
    >have no idea how to show the actual image. Can anyone[/color]
    give[color=blue]
    >me a hand or point me towards an example they know of. I
    >have searched the web and haven't found anything that is
    >of much use. Cheers and have a good one,
    >Tom
    >.
    >[/color]

    Comment

    Working...