Solved

Vb.net Datagridview image column/row click event

Posted on 2010-11-08
4
1,761 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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