I am working on a gridview in netadvantage 5.3. I need to put an image in a cell to denote a certain instance in the record. How do I do that or can it be done with this control version? Please help and respond asap.
Thanks so much in advance.
Hey.... thanks for the reply. I tried that and it worked... but it put the same image in every row cell. I have a case select statement in my for next but it still gives me the same image in each cell in the column. Any ideas? Here's the code of what I'm trying to achieve:
Me.UltraWebGrid1.DataBind() 'For Each row As DataGridItem In UltraWebGrid1.Items ' If row.Cells(4).Text = "PRIORITY" Then ' row.ForeColor = Color.Red ' End If 'Next
Dim img00 As String = "~/Images/Symbol Exclamation 1.png" Dim img100 As String = "~/Images/phone-button-green_16x16.png" Dim img200 As String = "~/Images/phone-button-blue_16x16.png" Dim img300 As String = "~/Images/phone-button-yellow_16x16.png" Dim img911 As String = "~/Images/phone-button-red_16x16.png"
For Each row As Infragistics.WebUI.UltraWebGrid.UltraGridRow In UltraWebGrid1.Rows
Dim x As String = row.Cells.FromKey("StatusNumber").Value
Select Case x
Case "" UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.ForeColor = Color.Transparent UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.BackgroundImage = img00 UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.CustomRules = "Background-repeat:no-repeat" UltraWebGrid1.Columns(0).Header.Style.CustomRules = "align:center" UltraWebGrid1.Columns(0).CellStyle.HorizontalAlign = HorizontalAlign.Center
Case "100"
'row.Style.ForeColor = Color.Red 'row.Style.BackColor = Color.Yellow UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.ForeColor = Color.Transparent UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.BackgroundImage = img100 UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.CustomRules = "Background-repeat:no-repeat" UltraWebGrid1.Columns(0).Header.Style.CustomRules = "align:center" UltraWebGrid1.Columns(0).CellStyle.HorizontalAlign = HorizontalAlign.Center
Case "200" ' row.Style.ForeColor = Color.Red ' row.Style.BackColor = Color.Yellow UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.ForeColor = Color.Transparent() UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.BackgroundImage = img200 UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.CustomRules = "Background-repeat:no-repeat" UltraWebGrid1.Columns(0).Header.Style.CustomRules = "align:center" UltraWebGrid1.Columns(0).CellStyle.HorizontalAlign = HorizontalAlign.Center
Case "300"
row.Style.ForeColor = Color.Yellow row.Style.BackColor = Color.Black UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.ForeColor = Color.Black() UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.BackgroundImage = img300 UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.CustomRules = "Background-repeat:no-repeat" UltraWebGrid1.Columns(0).Header.Style.CustomRules = "align:center" UltraWebGrid1.Columns(0).CellStyle.HorizontalAlign = HorizontalAlign.Center
Case "911"
row.Style.ForeColor = Color.Red row.Style.BackColor = Color.Yellow row.Style.Font.Bold = True
UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.ForeColor = Color.Yellow() UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.BackgroundImage = img911 UltraWebGrid1.Columns.FromKey("StatusNumber").CellStyle.CustomRules = "Background-repeat:no-repeat" UltraWebGrid1.Columns(0).Header.Style.CustomRules = "align:center" UltraWebGrid1.Columns(0).CellStyle.HorizontalAlign = HorizontalAlign.Center
End Select
If row.Cells.FromKey("Status").Value = "PRIORITY" Then row.Style.ForeColor = Color.LightBlue row.Style.BackColor = Color.Navy
End If
Next txtCount.Text = DataSet11.WebCalls.Rows.Count.ToString & " Call(s) Found" End Sub
Thanks again.
I've done it this way...
Gridname.Columns.FromKey("keyname").CellStyle.BackgroundImage = "images/yourImage.gif"
I hope that helps. Good luck!