Well I sort of got it...and I mean sort of...But there is still one issue...What I did was created a function in javascript like so:<script language="javascript" type="text/javascript">function ChangeRowColor(obj){if (obj.checked) {obj.parentElement.parentElement.style.backgroundColor='Yellow';}else{obj.parentElement.parentElement.style.backgroundColor='White';}}</script>
In my datagrid column for this check box I call this with: <ItemTemplate> <asp:CheckBox ID="chkSelector" onclick="ChangeRowColor(this)" runat="server" /> </ItemTemplate>
When I do click on the checkbox it does make the background row color yellow. HOWEVER, once I roll away from this row onto another row or anywhere else on the page the yellow is gone...and this is because of the rowcreated event that initially adds the onmouseover attributes for the gridview rows which is this: Protected Sub gvRequests_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvRequests.RowCreated Dim onmouseoverStyle As String = "this.style.backgroundColor='#D4EDFF'" Dim onmouseoutStyle As String = "this.style.backgroundColor='@BackColor'" Dim rowBackColor As String = String.Empty If (e.Row.RowType = DataControlRowType.DataRow) Then If e.Row.RowState = DataControlRowState.Alternate Then rowBackColor = System.Drawing.ColorTranslator.ToHtml(Me.gvRequests.AlternatingRowStyle.BackColor).ToString() Else rowBackColor = System.Drawing.ColorTranslator.ToHtml(Me.gvRequests.RowStyle.BackColor).ToString() End If e.Row.Attributes.Add("onmouseover", onmouseoverStyle) e.Row.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor)) End If End Sub
Issue is I dont want to get rid of this function as I like the mouse over effects on the grid. But because of this the highlight goes away :(. Any suggestions ?Thanks,Weblog -- [url]http://weblogs.sqlteam.com/jhermiz[/url]