Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is BackColor of Selected Row?

Status
Not open for further replies.

ISPrincess

Programmer
Feb 22, 2002
318
0
0
US
Is there a way to get the backcolor of a row in server code?

When the user clicks a button (say Process), then i need to loop thru the grid and capture the backcolor of each row in order to do something.

cannot write the following:
If dgGrid.items.item(i).backcolor = "Red" then
DoSomething()
End If

Nor this:
dgMoves.Items.Item(i).BackColor = System.Drawing.Color.Red

PH
I was walking home one night and a guy hammering on a roof called me a paranoid little weirdo.
In morse code.
-Emo Phillips
 
OK - I think I found the correct way to code this but still have a problem.

Code:
If dgMoves.Items(i).BackColor.Equals(System.Drawing.Color.LightSteelBlue) Then
                SetAlertMessage("Selected: " & i)
      End If

never equates to TRUE.

In my HTML I have Javascript . (I had to use the #b0c4de and not the color name because the javascript wasnt behaving)

Code:
SRow.style.backgroundColor = ( bg == '#b0c4de' ) ? '#ffffff' : '#b0c4de';

Also, dgMoves.Items(i).BackColor.ToString returns Color.Empty.

I think I amm missing something very obvious (as usual), please, can anyone see what is wrong here?

PH
I was walking home one night and a guy hammering on a roof called me a paranoid little weirdo.
In morse code.
-Emo Phillips
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top