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

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top