Skip to Content
0
Jul 27, 2019 at 09:56 AM

Grid Fore Color

292 Views Last edit Aug 23, 2019 at 10:26 AM 6 rev

Hi All

I am trying to change the fore color of a row in the grid depending on some condition.I load my grid data on result of a query.Now i loop through the grid and want to change the forecolor ,I am getting error

Row - Invalid index [66000-31]

For i As Integer = 0 To oGrid.Rows.Count - 1 
 oEdit1.Value = oGrid.DataTable.GetValue("img", oGrid.GetDataTableRowIndex(i)) 
 If oEdit1.Value = "+" Then
Dim newColor As Integer = 16777088 
 oGrid.CommonSetting.SetRowFontColor(i, newColor)
end if

next i

Also tried ogrid .getdatatablerowindex(i) instead of i but getting same error

Row - Invalid index [66000-31]

For i As Integer = 0 To oGrid.Rows.Count - 1 
 oEdit1.Value = oGrid.DataTable.GetValue("img", oGrid.GetDataTableRowIndex(i)) 
 If oEdit1.Value = "+" Then
Dim newColor As Integer = 16777088 
 oGrid.CommonSetting.SetRowFontColor(oGrid.GetDataTableRowIndex(i), newColor)
end if

next i


PLEASE HELP TIA