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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindControl

Status
Not open for further replies.

Dimitrie1

Programmer
Joined
Jan 5, 2007
Messages
138
Location
CA
I have a gridview (gridview2) with a template that contains another gridview (gridview3). I am trying to highlight the last row of gridview3. I used findcontrol but believe I am doing something wrong.

Code:
Protected Sub GridView3_PreRender(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim irow As Integer
        Dim x As GridView
        x = GridView2.FindControl("GridView3")
        irow = x.Rows.Count - 1
        If irow > 1 Then
            x.Rows(irow).BackColor = Drawing.Color.Cornsilk
        End If
    End Sub
 
sorry - I meant to post in .NET

please ignore I'll repost in the proper forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top