Solved

Vb.net Datagridview image column/row click event

Posted on 2010-11-08
4
1,740 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
  • 2
4 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
Comment Utility
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 25

Expert Comment

by:Shaun Kline
Comment Utility
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
Comment Utility
shaun, sorry the code is vb.net, not asp.net
0
 
LVL 42

Expert Comment

by:sedgwick
Comment Utility
@rflorencio,  test my code?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now