Click here to Skip to main content
15,905,776 members
Home / Discussions / C#
   

C#

 
QuestionAssociating Icons in C# Pin
Rohithaa6-Apr-07 20:01
Rohithaa6-Apr-07 20:01 
AnswerRe: Associating Icons in C# Pin
Nader Elshehabi6-Apr-07 23:20
Nader Elshehabi6-Apr-07 23:20 
QuestionRe: Associating Icons in C# Pin
Rohithaa6-Apr-07 23:58
Rohithaa6-Apr-07 23:58 
AnswerRe: Associating Icons in C# Pin
Nader Elshehabi7-Apr-07 2:21
Nader Elshehabi7-Apr-07 2:21 
QuestionUsing Controls in Classes [modified] Pin
freshonlineMax6-Apr-07 19:08
freshonlineMax6-Apr-07 19:08 
AnswerRe: Using Controls in Classes Pin
Nader Elshehabi6-Apr-07 23:23
Nader Elshehabi6-Apr-07 23:23 
Questionseveral events - one action Pin
Glen Harvy6-Apr-07 17:29
Glen Harvy6-Apr-07 17:29 
AnswerRe: several events - one action Pin
Not Active6-Apr-07 17:43
mentorNot Active6-Apr-07 17:43 
GeneralRe: several events - one action Pin
Glen Harvy6-Apr-07 17:49
Glen Harvy6-Apr-07 17:49 
GeneralRe: several events - one action Pin
Sathesh Sakthivel6-Apr-07 18:02
Sathesh Sakthivel6-Apr-07 18:02 
GeneralRe: several events - one action Pin
Glen Harvy6-Apr-07 18:19
Glen Harvy6-Apr-07 18:19 
GeneralRe: several events - one action Pin
Sathesh Sakthivel6-Apr-07 18:22
Sathesh Sakthivel6-Apr-07 18:22 
GeneralRe: several events - one action Pin
Scott Dorman6-Apr-07 19:49
professionalScott Dorman6-Apr-07 19:49 
You need to cast sender to the actual data type of the control. Since your sender is a DataGridView, you would need something like this:
C#
private void bookingCellClick(object sender, DataGridViewCellEventArgs e)
{
DataGridView dgv = sender as DataGridView;
object tag = dgv.Tag;
}

What, exactly, are you trying to accomplish by accessing the Tag property of the control itself rather than data from the actual cell that was clicked? Pretty much anything you need should be available from the e paramater of the event handler.


-----------------------------
In just two days, tomorrow will be yesterday.

GeneralRe: several events - one action Pin
Glen Harvy6-Apr-07 23:07
Glen Harvy6-Apr-07 23:07 
GeneralRe: several events - one action Pin
Scott Dorman7-Apr-07 4:28
professionalScott Dorman7-Apr-07 4:28 
GeneralRe: several events - one action Pin
Glen Harvy7-Apr-07 12:11
Glen Harvy7-Apr-07 12:11 
QuestionHow to add extra information to Buttons? Pin
Khoramdin6-Apr-07 16:38
Khoramdin6-Apr-07 16:38 
AnswerRe: How to add extra information to Buttons? Pin
Mark Greenwood6-Apr-07 19:12
Mark Greenwood6-Apr-07 19:12 
GeneralRe: How to add extra information to Buttons? Pin
Khoramdin6-Apr-07 20:17
Khoramdin6-Apr-07 20:17 
Questionhow to start other applications with no window ? Pin
hdv2126-Apr-07 15:47
hdv2126-Apr-07 15:47 
AnswerRe: how to start other applications with no window ? Pin
Sathesh Sakthivel6-Apr-07 16:12
Sathesh Sakthivel6-Apr-07 16:12 
QuestionC Function returns struct - how to use in c#? Pin
Grizzley906-Apr-07 11:53
Grizzley906-Apr-07 11:53 
AnswerRe: C Function returns struct - how to use in c#? Pin
Leslie Sanford6-Apr-07 14:11
Leslie Sanford6-Apr-07 14:11 
GeneralRe: C Function returns struct - how to use in c#? Pin
Grizzley907-Apr-07 2:38
Grizzley907-Apr-07 2:38 
GeneralRe: C Function returns struct - how to use in c#? Pin
Leslie Sanford7-Apr-07 4:39
Leslie Sanford7-Apr-07 4:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.