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()
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()