You want to display the file in the grid, not just its location yes?
Pretty straightforward...
Add a template column to your grid.
Add an image control to the ItemTemplate of the column (set its ID=
imgShow, or something meaningful)

<asp:TemplateColumn HeaderText="Image"><ItemTemplate><asp:Image
ID="imgShow" Runat="server"></asp:Image></ItemTemplate></asp:TemplateColumn>

Add an ItemDataBound event handler for the grid.  This will get called
everytime a row is bound to the grid, which will look something like
this...


    Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
        Dim drv As DataRowView
        Dim img As System.Web.UI.WebControls.Image
        If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
            drv = e.Item.DataItem
            img = e.Item.FindControl("imgShow")
            img.ImageUrl = drv("FileLocation")

        End If
    End Sub




On 6/22/05, Michael Swanson <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a database that has roughly 60,000 products in it.  In the
> table it has the product name, price, and where the file is located.
> The image file location looks like this: ../images/doc johnson/110 dpi
> files/BU FILES 110/0200 Series BU/0200-00-BU.jpg
> What I need to do is build a datagrid that pulls all of this
> information out of the database, and sets up the column that holds the
> file location as a viewable picture instead of a file location.  If
> anyone could help me figure this out, or tell me another way to do
> what I want I would appreciate it.
> 
> 
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 
> 


-- 
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to