Show a Graphic in the click event in a specific cell in GridView

Hi!

Is possible to show a graphic when the user does click on a cell of the grid control?


I need help for this topic, i didn't find about it. I need show a graphics with information about the cell that was clicked, in a modal or in the same grid.

Thanks

1 Reply

AR Arulpriya Ramalingam Syncfusion Team October 10, 2017 08:48 AM UTC

Hi Emma,   
   
Thanks for using Syncfusion products.   
   
As per the grid architecture, the GridCellClickEventHandler does not hold the graphics of CurrentCell and you can create the graphics for the grid in CellClick event using CreateGraphics() method. If you want to get the cell rectangle and location, the RangeInfoToRectangle() method of the current cell and Location property of MouseEventArguments can be used. Please refer to the below code sample,   
   
Code example  
   
   
//Event Triggering   
this.gridControl1.CellClick += GridControl1_ CellClick;   
   
//Event Customization   
private void GridControl1_CellClick(object sender, GridCellClickEventArgs e)   
  
    Graphics g = this.gridControl1.CreateGraphics();   
    //To get the client rectangle of current cell   
    Rectangle cellRectangle =this.gridControl1.RangeInfoToRectangle(GridRangeInfo.Cell(e.RowIndex,e.ColIndex));   
    //To get the cursor position of current cell   
    Point mousePointLocation = e.MouseEventArgs.Location;   
  
   
   
   
Please let us know if you have any other queries.   
   
Regards,   
Arulpriya 


Loader.
Up arrow icon