Note that there are some explanatory texts on larger screens.

plurals
  1. POOnmouseover ,Onmouseout attributes were not working in gridview
    primarykey
    data
    text
    <p>I have tried all possible ways for this highlighting a row in gridview, I can't be able to achive this.I tried direct CSS-Classes,javascript. Pls note me where I made a mistake. Thanks in advance...</p> <pre><code>protected void test_databound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.background='#D1DDF1';"; e.Row.Attributes["onmouseout"] = "this.style.background='#EFF3FB';"; //e.Row.Attributes["onmouseover"] = "javascript:SetMouseOver(this)"; //e.Row.Attributes["onmouseout"] = "javascript:SetMouseOut(this)"; //e.Row.Attributes.Add("onmouseover", "className='highlighted1'"); //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=''"); //e.Row.Attributes.Add("style", "cursor:pointer;"); //e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#000000'"); //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#000000'"); //e.Row.Attributes.Add("style", "cursor:pointer;"); //e.Row.Attributes.Add("onmouseover", "this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='#000000'"); //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalstyle"); //e.Row.Attributes.Add("style", "cursor:pointer;"); } //e.Row.Attributes.Add("onmousedown", "IsMouseDown(this,true)"); //e.Row.Attributes.Add("onmouseup", "IsMouseDown(this,true)"); //e.Row.Attributes.Add("onmouseover", "HighlightRow(this,true)"); //foreach (GridViewRow grow in gvCatalogList.Rows) //{ // e.Row.Attributes.Add("onmousedown", "IsMouseDown(this)"); // e.Row.Attributes.Add("onmouseup", "IsMouseDown(this)"); // grow.Attributes["onmouseover"] = "highlight(this, true);"; // grow.Attributes["onmouseout"] = "highlight(this, false);"; // HttpResponse myHttpResponse = Response; // HtmlTextWriter myHtmlTextWriter = new HtmlTextWriter(myHttpResponse.Output); // grow.Attributes.AddAttributes(myHtmlTextWriter); //} } </code></pre> <p>This is my design page</p> <pre><code>&lt;asp:GridView ID="gvCatalogList" GridLines="None" runat="server" AutoGenerateColumns="False" PageSize="5" AllowPaging="true" OnPageIndexChanging="OnPageIndexChanging_gvCatalogList" OnRowDataBound="test_databound"&gt; &lt;FooterStyle CssClass="pagination-flickr" /&gt; &lt;PagerStyle CssClass="pagination-flickr" HorizontalAlign="Center" /&gt; &lt;Columns&gt; &lt;asp:TemplateField HeaderText="Estimation ID"&gt; &lt;HeaderStyle Wrap="true" Width="10%" /&gt; &lt;ItemTemplate&gt; &lt;div style="width: 40px; white-space: normal"&gt; &lt;asp:Label ID="label1" Text='&lt;%# Eval("ProjectEstimationVersionID") %&gt;' runat="server"&gt;&lt;/asp:Label&gt; &lt;asp:HiddenField ID="hiddenEstimationID" runat="server" Value='&lt;%# Eval("ProjectEstimationID") %&gt;' /&gt; &lt;/div&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload