Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0custom gridview controlcustom gridview control
Previous
 
Next
New Post
7/26/2007 8:23 PM
 

My module contains a custom gridview control. In the GridView_RowDataBound event I added mouseover events to to change the background color when I hover over it. I want to be able to click anywhere in that highlighted row to NavigateURL to my Edit module. Currently I use the edit pencil (see below) to navigate to the edit page. How can I navigate by clicking anywhere in the Row?<asp:HyperLink ID="editPatch" runat="server" NavigateUrl='<%# EditURL("PatchListID",DataBinder.Eval(Container.DataItem,"PatchListID")) %>' ImageUrl="~/images/edit.gif" />

 

 

 

 
New Post
7/26/2007 8:26 PM
 

I've noticed that pasting anything other than plain text into this Rich Text Editor here in the forum is FUTILE! It never comes across correctly and editing makes it worse. Is there a known problem with this? I know there's an update to be released soon; I hope it fixes this problem.

Jon

 
New Post
7/27/2007 5:43 AM
 

You told me your using a gridview and you're inserting the HyperLink but this only activates the text or the image?

You must manipulate the cells. I personally use repeaters because I can fine tune the hole display (but more effort). 

 
New Post
7/27/2007 12:11 PM
 

Here's the solution for anyone interested. It'll be most appropriate to set the mouseover colors via CSS. for more information visit The Code Project.

Jon

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
e.Row.Attributes.Add(
"onmouseover", "this.style.backgroundColor='Silver'")
e.Row.Attributes.Add(
"onmouseout", "this.style.backgroundColor='white'")
If e.Row.RowType = DataControlRowType.DataRow Then
  Dim link As HyperLink = DirectCast(e.Row.FindControl("editPatch"), HyperLink)
    e.Row.Attributes.Add(
"onclick", "location.href='" + link.NavigateUrl + "';")
  End If
End
SubProtected Overloads Overrides Sub Render(ByVal writer As HtmlTextWriter)
  For Each r As GridViewRow In GridView1.Rows
    If r.RowType = DataControlRowType.DataRow Then
      Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl00")
      Page.ClientScript.RegisterForEventValidation(r.UniqueID +
"$ctl01")
    End If
    Next
  MyBase.Render(writer)
End Sub

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0custom gridview controlcustom gridview control


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out