Asp 1.1 Add Image to datagrid via datatable binding

P

pmclinn

'Data Grid is named dgFabrics.
How do I get the image to bind on pageload?

Dim dt As New DataTable
Dim dr As DataRow
Dim img As New System.Web.UI.WebControls.Image
dt.Columns.Add("Add", GetType(System.Boolean))
dt.Columns.Add("Model", GetType(System.String))
dt.Columns.Add("Image",
GetType(System.Web.UI.WebControls.Image))
img.ImageUrl = "\Images\Fabrics\Animals_Small.jpg"
img.DataBind()

dr = dt.NewRow()
dr(0) = False
dr(1) = "Test"
dr(2) = img

dt.Rows.Add(dr)
dgFabrics.DataSource = dt
dgFabrics.DataBind()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top