|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Row focus and changing row colour
I would like to be able to give a single row within a datagrid focus. I would like to be able to cycle through the datagrid checking a value within a certain cell of each row and according to certain condition give that row focus and then continue and change that single rows background colour and then move on to the next row.
Thanks in advance Louisa |
|
#2
|
|||
|
|||
|
OnItem
Hi,
There is a datagrid protected method called 'OnItemDataBound', using this method you can trap each of the Rows and cellls in a datagrid. For Example: For i = 0 to dgMine.Items.Count -1 If (dgMine.Items(i).Cells().Text.ToString() = "Some Condition") Then ' Change the Background Color dgMine.Items(i).BackColor = MyColor Else dgMine.Items(i).BackColor = YourColor End If Next Hope this helps. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > Row focus and changing row colour |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|