on 2019 Jul 27 10:56 AM
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
Hello Dear,
It's very easy to solve its, let me explain you.
For the method oGrid.CommonSetting.SetRowBackColor the first line is 1
For the method oGrid.DataTable.GetValue the first line is 0
So for fix your problem just use +1 for change the forecolor.
check the code below:
For i As Integer = 0 To oGrid.Rows.Count - 1
Dim var As String = oGrid.DataTable.GetValue("img", i)
If var = "+" Then
Dim newColor As Integer = 16777088
oGrid.CommonSetting.SetRowFontColor((i+1), newColor)
end if
next i
Good Luck.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you so much sir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
9 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.