?
Solved

click on a row in a datagrid

Posted on 2005-04-25
9
Medium Priority
?
242 Views
Last Modified: 2010-04-16

I have a simple datagrid which loads from a arraylist.
I want know how to call a method when I click anyway on the row. Failing that I would like to know how the get something to happen when I click in a specific place.

I presume the even would send the object from my arraylist so I can identify it?
0
Comment
Question by:thedogeater
  • 4
  • 3
8 Comments
 
LVL 6

Expert Comment

by:wimthepimscake
ID: 13857168
0
 

Author Comment

by:thedogeater
ID: 13857303
Thanks but this does not help me.

I am creating a windows application not an ASP page.
0
 
LVL 6

Expert Comment

by:wimthepimscake
ID: 13857308
oeps sorry mate
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 6

Expert Comment

by:wimthepimscake
ID: 13857322
This may help it's an example on how to seelct the entire row onclick

private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
 
{
      System.Drawing.Point pt = new Point(e.X, e.Y);
      DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
      if(hti.Type == DataGrid.HitTestType.Cell)
      {
           dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column);
           dataGrid1.Select(hti.Row);
      }
 }  
0
 

Author Comment

by:thedogeater
ID: 13858877
Thaks again this is not working for me either
can I not get sender to tell me what row it is on?
I am searching thru it but dont see the var.
0
 

Author Comment

by:thedogeater
ID: 13859132
never mind I have it!


DataGrid aGrid = (System.Windows.Forms.DataGrid)sender;
CurrencyManager xCM = (CurrencyManager)aGrid.BindingContext[aGrid.DataSource, aGrid.DataMember];
//and what ever ojb is in there.
object xDRV = xCM.Current;
0
 

Author Comment

by:thedogeater
ID: 13859140
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 14080924
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

862 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