Hi Guys,
I am having a problem changing the Cursor icon to a hand while hovering or entering over a RadLabelElement within the RadGridView GridViewCommandColumn cell. I am using the most current version of the controls.
The following is how my controls are placed:
I have a RadGridView control, with a GridViewCommandColumn that contains a RadMenuElement and 4 RadLabelElements.
My problem arises when I try to use the MouseEnter() event handler on the RadLabelElement to change the Cursor type from the default (arrow) to a Hand. It will not make the change.
The following is an outline of the source code that contains the problems described above:
private void gvManageDocs_CellFormatting(object sender, CellFormattingEventArgs e) | |
{ | |
if (e.CellElement is GridCommandCellElement) | |
{ | |
GridViewRowInfo gvrRow = e.CellElement.RowInfo; | |
e.CellElement.Children.Clear(); | |
RadMenuElement buttonElement = new RadMenuElement(); | |
RadLabelElement lblLabel = new RadLabelElement(); | |
lblLabel.Text = "View"; | |
lblLabel.Click += new EventHandler(lblView_Click); | |
lblLabel.MouseLeave += new EventHandler(lblLabel_MouseLeave); | |
lblLabel.MouseEnter += new EventHandler(lblLabel_MouseEnter); | |
lblLabel.ForeColor = Color.Blue; | |
buttonElement.Items.Add(lblLabel); | |
lblLabel = null; | |
lblLabel = new RadLabelElement(); | |
lblLabel.Text = "Modify"; | |
lblLabel.Click += new EventHandler(lblModify_Click); | |
lblLabel.MouseLeave += new EventHandler(lblLabel_MouseLeave); | |
lblLabel.MouseEnter += new EventHandler(lblLabel_MouseEnter); | |
lblLabel.ForeColor = Color.Blue; | |
buttonElement.Items.Add(lblLabel); | |
lblLabel = null; | |
} | |
e.CellElement.Children.Add(buttonElement); | |
} | |
void lblLabel_MouseEnter(object sender, EventArgs e) | |
{ | |
Cursor = Cursors.Hand; | |
((RadLabelElement)sender).ForeColor = Color.Red; | |
} | |
void lblLabel_MouseLeave(object sender, EventArgs e) | |
{ | |
Cursor = Cursors.Arrow; | |
((RadLabelElement)sender).ForeColor = Color.Blue; | |
} | |
Please let me know what I can do to solve this issue.
Many thanks,
Mike