Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cursor Hand Symbol Change

I am having a Gridview.In that ther are 2 columns,like Image and Status. In image columns some of the images will be disabled. For that,the Cursor Hand Symbol should not come.How to change this. Here is my code...

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="List.ascx.cs"
Inherits="List" %>
 <style type="text/css">
 .noHand 
 {
  cursor:default
 } 
 </style>
 ..........
 .........
  <asp:CommandField ButtonType="Image" ShowEditButton="True" HeaderText="Edit"        EditImageUrl="~/IMAGES/Edit.gif">
   <ItemStyle HorizontalAlign="Center" />
   </asp:CommandField>

Code Behind

protected void Grid_RowDataBound(object sender, GridViewRowEventArgs e)
{  
       if (Status.Value == "True")
        {
           //Here Cursor Hand symbol should come
        }
        else
        {
          e.Row.Cells[9].CssClass = "nohand";
        }
}
like image 862
RobinHood Avatar asked Dec 08 '25 06:12

RobinHood


1 Answers

Try using the CssClass property on the cells:

e.Row.Cells[cellIndex].CssClass = "nohand";

cellIndex being a zero based index of your cells on each row.

Then create a css class in your existing stylesheet (or create a new stylesheet and reference it from your application) called nohand that includes the rule cursor:default;.

like image 111
Nick Silberstein Avatar answered Dec 09 '25 19:12

Nick Silberstein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!