---
title: "How to get single click event on image in column of DevExpress Grid Control using wpf?"  
description: "How to get single click event on image in column of DevExpress Grid Control using wpf?"  
author: "Anonymous User"  
published: 2013-09-03  
updated: 2013-09-03  
canonical: https://www.mindstick.com/forum/1436/how-to-get-single-click-event-on-image-in-column-of-devexpress-grid-control-using-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 2 minutes  

---

# How to get single click event on image in column of DevExpress Grid Control using wpf?

I have [Navigation bar](https://www.mindstick.com/forum/33939/how-to-create-transparent-navigation-bar-in-xcode) [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) and one [NavBar](https://www.mindstick.com/forum/1331/expand-the-navbar-group-of-nabarcontrol-on-button-click-using-devexpress-navbarcontrol) Group contains the grid control. I want to get the single [click event](https://www.mindstick.com/forum/424/how-to-call-form_paint-event-on-button-click-event) on particular image which is in one column of grid control and on [image click](https://www.mindstick.com/forum/34670/how-can-i-edit-row-data-using-single-row-image-click-in-vb-dot-net-data-gridview) event I have to show the pop-up for some menu options.

I’m using the grid control’s [preview](https://www.mindstick.com/forum/429/i-want-to-get-full-path-of-lt-asp-fileupload-gt-and-then-client-can-click-the-preview-button-to-see-what-file-he-here-has-uploaded) mouse left [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) up event to get the click but it’s not working because the grid control resides in Navbar control.

Basically my [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is that I am not able to get the single click on image which is on column of grid control and [grid column](https://www.mindstick.com/forum/1676/automatically-resize-wpf-grid-column) itself resides in one Navbar group of NavBar Control.

This link has my demo project.

Any help will be appreciated.

## Replies

### Reply by Sumit Kesarwani

Hi Jacob,

The below code will solve your problem:-

private void gridControl1_PreviewMouseDown(object sender, MouseButtonEventArgs e) {

TableViewHitInfo hit = tableView1.CalcHitInfo(e.OriginalSource as DependencyObject);

```
if (hit.InRowCell) { gridControl1.View.FocusedRowHandle= hit.RowHandle;   if (e.ClickCount ==1)    {        if (e.XButton1== MouseButtonState.Released)        {           if(hit.Column.FieldName == "number")               {                     
var row = gridControl1.GetFocusedRow();                     
data d = (data)row;                     
MessageBox.Show(d.number.ToString());                     
x = d.number;                    }                    if(e.RightButton == MouseButtonState.Pressed)                    {                        if (hit.Column.FieldName =="image")                       
{                           
gridControl1.View.FocusedRowHandle = hit.RowHandle;                           
var row = gridControl1.GetFocusedRow();                           
data d = (data)row;                            x = d.number;                           
popup.StaysOpen = true;                           
popup.IsEnabled = true;                            popup.IsOpen = true;                       
}                    }                }}}
```


---

Original Source: https://www.mindstick.com/forum/1436/how-to-get-single-click-event-on-image-in-column-of-devexpress-grid-control-using-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
