I have an UltraListView (View = List) with icons and check boxes enabled. How do I capture mouse clicks on the icon?
void listView_MouseClick(object sender, MouseEventArgs e){ UltraListView listView = sender as UltraListView; UltraListViewUIElement controlElement = listView.UIElement; ImageUIElement imageElement = controlElement.ElementFromPoint( e.Location ) as ImageUIElement;
if ( imageElement != null ) { UltraListViewItem item = imageElement.GetContext( typeof(UltraListViewItem) ) as UltraListViewItem;
if ( item != null ) this.OnImageClick( item ); }}
private void OnImageClick( UltraListViewItem item ){}
Thanks, that worked.
Another question, is there any way to control the disabled appearance of an ultralistviewitem? I'm using the appstylist and it does not provide a disabled option (neither does any of the appearance properties). The big thing is, since i'm toggling between icons when clicked on, I don't want the icon to change to a disabled state (gray color) when the listviewitem is disabled. I want the item to be disabled (and the icon for that matter) but I don't want the color of the icon to change.