Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Datagrid

Posted on 2004-04-20
7
Medium Priority
?
513 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
Independent Software Vendors: 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!

 
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 1200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses

885 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