Solved

Datagrid

Posted on 2004-04-20
7
502 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

16 Experts available now in Live!

Get 1:1 Help Now