this is the code that i've written for changing bg color of a cell of dartagrid.would please tell me is it correct?
sub Changebg(s As Object,e As System.EventArgs)
Dim c
for each myItem As DataGridItem in DataGrid1.Items
c=myItem.Cells(22).text
If Left(c, 1) = "1" Then
myItem.Cells(12).BackColor = Red
End If
dim c1
c1=left(c,2)
If Right(c1, 1) = 1 Then
myItem.Cells(11).BackColor = Red
End If
Dim c2
c2=left(c,3)
If Right(c2, 1) = 1 Then
myItem.Cells(10).BackColor = Red
End If
Dim c3
c3=left(c,4)
If Right(c3, 1) = 1 Then
myItem.Cells(15).BackColor = Red
End If
Dim c4
c4=left(c,5)
If Right(c4, 1) = 1 Then
myItem.Cells("16").BackColor = Red
End If
Dim c5
c5=left(c,6)
If Right(c5, 1) = 1 Then
myItem.Cells("18").BackColor = Red
End If
Dim c6
c6=left(c,7)
If Right(c6, 1) = 1 Then
myItem.Cells("19").BackColor = Red
End If
If Right(c, 1) = 1 Then
myItem.Cells("21").BackColor = Red
End If
next
End Sub
and i set OnDataBinding="changebg" for my datagrid properties
It's near a month that i'm searching for the solution but i couldn't find anything usefull
thank you
|