Solved

Vb.net Datagridview image column/row click event

Posted on 2010-11-08
4
1,790 Views
Last Modified: 2012-05-10
I plan use a datagridview with imagecolumn. When user click in the cell a question is made if, he want delete row. How can catch row and cell position.
0
Comment
Question by:rflorencio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 34083781
you can use DataGridView.CellClick Event:http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellclick.aspxprivate void dataGridView1_CellClick(object sender,    DataGridViewCellEventArgs e){    DataGridViewImageCell cell = (DataGridViewImageCell)        dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];}
0
 
LVL 26

Expert Comment

by:Shaun Kline
ID: 34083797
A better approach would be to attach javascript to the onclick (javascript) event to ask the question. This would prevent a round trip to the server just to ask the question. You can attach the javascript using the OnRowDataBound event.
0
 

Author Comment

by:rflorencio
ID: 34083948
shaun, sorry the code is vb.net, not asp.net
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 34083976
@rflorencio,  test my code?
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question