I need to know when a user mouses over the image column in a row so that I can present a larger popup with a bigger image and more details.
What would my approach be to accomplish this?
Thank you,
Mike
Hi Mike,
The approach I would use is through a style event setter for the ComboCellControl. You would create a style that targets ComboCellControl and add an EventSetter to handle the MouseEnter event. Then inside the event, you can check the Content of the ComboCellControl for whether its an Image or not. If its an Image then you can perform your logic for displaying a larger popup. The code would look something like the following.
<ig:XamMultiColumnComboEditor> <ig:XamMultiColumnComboEditor.Resources> <Style TargetType="{x:Type ig:ComboCellControl}"> <EventSetter Event="MouseEnter" Handler="OnMouseEnterHandler"/> </Style> </ig:XamMultiColumnComboEditor.Resources> </ig:XamMultiColumnComboEditor>
void OnMouseEnterHandler(object sender, MouseEventArgs e) { if ((sender as ComboCellControl).Content is Image) { // popup logic here. } }
I'll try this and get back to you.
Thank you very much.
Rob,
Finally figured out where and how to get this working and now I'm getting a mouse enter event, so thank you for that.
Now that I am there, my issue is that all I have is an image, and I was hoping that the control would work somewhat like a grid in that if you know what the row is you can grab a value from a cell in that row. Is it possible for me to add a column to the dropdown and make it invisible and then when the mouse enter event fires know what the row is that is housing the ImageComboColumn?
Thanks again for all of your help.
You can get the row for the cell you moused over by using the ComboCellControl's Cell property. Each cell knows about the row it belongs to and each row knows about the data it represents in the grid. The code you should use in your MouseEnter/MouseLeave event should be:
object rowData = (sender as ComboCellControl).Cell.Row.Data;
The Data property in the row will be your underlying data object so you can access any of your custom properties from there.
Thanks you very much for your help on this. I'll look at this later and get back to you.
Rob, yes this is all working now, thank you very much for all of your help.
You're very welcome. Glad we could get this resolved for you.