Solved

Datagrid

Posted on 2004-04-20
7
504 Views
Last Modified: 2010-04-15
I want to create a windows form with a textfield where I can enter a MODEL NUMBER of the TV for example click search button and search a database table for a model number. Once a match is met I would like to populate a datagrid with the title for the model number. I want to be able to double click on a title. If I double click on a title in a datagrid I want a textfield on a form to get the value of a title from a datagrid. Any tutorials out there that accouplish something similar? Can anybody help?

This is what the datagrid should look like after it is populated with a data from a database.
----------------------------------------------
| Model Number |  Title of The Model   |
----------------------------------------------
| vpw425           | View Sonic              |
----------------------------------------------
| kde50xbr         | Sony Plasma TV      |
----------------------------------------------
0
Comment
Question by:TransBind
  • 3
  • 2
  • 2
7 Comments
 
LVL 9

Expert Comment

by:malharone
ID: 10870722
this is a great solution .. i've always used it for reference when learning databinding stuff in .net

hope this helps
0
 
LVL 7

Author Comment

by:TransBind
ID: 10870763
u forgot a link?
0
 
LVL 9

Expert Comment

by:malharone
ID: 10870773
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Author Comment

by:TransBind
ID: 10870946
can u point to a particular tutorial that deals with my problems?
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 10875722
I think this will solve your problem:

You can use the DataGrid's double-click event and its HitTest method to catch a double click on a header.
 
     private void dataGrid1_DoubleClick(object sender, System.EventArgs e)
 
     {
 
          System.Drawing.Point pt = dataGrid1.PointToClient(Cursor.Position);
 

 
          DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
 

 
          if(hti.Type == DataGrid.HitTestType.ColumnHeader)
 
          {
 
               MessageBox.Show("double clicked clicked column header " + hti.Column.ToString());
 
          }
 
     }
 
0
 
LVL 7

Author Comment

by:TransBind
ID: 10884385
TheAvenger: how about a double click event on a cell? to get its value
0
 
LVL 20

Accepted Solution

by:
TheAvenger earned 300 total points
ID: 10886017
Have a look here. The problem is explained and there is some example code (through a link):

http://www.syncfusion.com/faq/winforms/search/869.asp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

25 Experts available now in Live!

Get 1:1 Help Now