At the outset i would like to welcome all as this is my first post on this forum :)
probably i've got a simple problem for most of you, namly:
I want to dynamically replace ImageUrl into DadaGrid cell. I've already prepare a right type of field (Image Field) and this is my code:
Private Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.Cells(3).Text = "1" Then
e.Row.Cells(3).Text = "Online"
DirectCast(e.Row.Cells(4).Controls(0), Image).ImageUrl = "~/Css/green.png"
'e.Row.Cells(9).ForeColor = System.Drawing.ColorTranslator.FromHtml("#489A38")
'e.Row.ForeColor = System.Drawing.Color.LightGray
e.Row.Cells(3).Text = "Offline"
DirectCast(e.Row.Cells(4).Controls(1), Image).ImageUrl = "~/Css/red.png"
And i.ve got this error:
Specified argument was out of the range of valid values.Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and whe
View Complete Post