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";
}
}
Try using the CssClass property on the cells:
cellIndexbeing 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
nohandthat includes the rulecursor:default;.