In the XamGrid, what is the best way to change the mouse cursor (to a hand) upon mouse-over cells in a particular column?
hey thans in advance, my question is that how can i set this method to the perticuler column where i have used multicolumn listview so column name which is ID is in other xml and i want to change the curser in the column which is in the listview so please help me
you can mail me on ankita.patel@acmatix.com ..pleaze help!
Thanks Elena, this works now.
Please note that I also had to implement a MouseLeave event to make sure that the pointer would get reset when leaving the cell.
The reason my example solution had errors is because I changed the references to the Infragistics Components as I did not want to include those dlls. If you wanted to get it to work I would suggest you remove the references to the 3 Infragistics dlls and re-add them.
Hello Andy99,
For some reason I get an error message when I try to run the sample. However I have a look at your code and I notice that you have set the cursor for the CellControl. After some investigation I noticed that the XamGrid handles differently this scenario and for the CellControl, so I can suggest you set the cursor directly on the Cursor property of the window:
this.Cursor = Cursors.Hand;
Please let me know if this still doesn’t suit your scenario.
Elena,
No, this does not work - please see the attached example and advise.
XamDataGrid exposes event named CellControlAttached, which you can use to set a different properties for a cell when it is loaded. This is why I believe that it is suitable to add the handler of the MouseMove event there.
private void xamGrid1_CellControlAttached(object sender, CellControlAttachedEventArgs e)
{
e.Cell.Control.MouseEnter += new MouseEventHandler(Control_MouseEnter);
}
Please let me know if this doesn’t suit your scenario.