We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

IsOverImage attribute not set to true when the mouse is click over an image.

Hi, I have a virtual grid control and the celltype is set to ComboBox and DerivedComboBox. I set an image to the cell, I want to know if the click is over the image when user clicks the cell. I used e.IsOverImage. It always returns false even though I am clicking on the image. Is this a bug and can you suggest a workaround? Thanks Dongxian

3 Replies

Administrator February 28, 2005 11:03 PM UTC

IsOverImage only applies to a Static celltyle where style.ImageIndex and style.ImageList is used to set the image into the cell. Here is the class reference entry on this property. /// Indicates if the mouse was over an image (see cref="GridStyleInfo.ImageIndex") /// in a static cell when the mouse was released. How are you putting teh image into your combobox? Do you know a relative rectangle in the cell where teh image is being drawn? If so, you can see if the click point is in this releative rectangle offset by the top-left corner of teh cell which you can get from a call to grid.ViewLayout.RowColToPoint.

DL Dongxian Li March 1, 2005 03:05 PM UTC

Thanks. I set the ImageList and ImageIndex of the ComboBox. Since I know the size of the image so I am able to get if the click is within the image rectangle using the RowColToPoint() method. But it would be so much better if IsOverImage is set to true by the grid automatically since the property is already there. Can this be an enhancement in the future? Thanks Dongxian

Administrator March 1, 2005 04:22 PM UTC

Yes. This has been entered as defect #72 in our Open Issues database.
Loader.
Live Chat Icon For mobile
Up arrow icon