?
Solved

datagridview combobox bind

Posted on 2007-03-22
4
Medium Priority
?
491 Views
Last Modified: 2013-12-17
how do you bind a datagrid's combo box to a dataset or table?  I am setting the grid up in the designer, declaring the row name, then want to bind in code.

So I have the first column in the datagrid with the name "customerName" and a datatable with a column by the same name I want to populate it with.
0
Comment
Question by:jackjohnson44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
_Eyeball_ earned 2000 total points
ID: 18774114
0
 

Author Comment

by:jackjohnson44
ID: 18774173
The solution is in the article.  It didn't mention binding to a combobox in a datavgridview.
0
 
LVL 2

Expert Comment

by:_Eyeball_
ID: 18774267
yes it does not! but the binding works always the same nevermind where the combobox is! When the binding works with a combobox directly in a windows.forms it also works with a datagridview...

If i missunderstand a problem in your question please try to explain it in a different way or show me the code where the troubles occure!

best regards
0
 

Author Comment

by:jackjohnson44
ID: 18775385
I am accepting to close the question, but I really don't think that you read the question.  Binding to a datagridview combobox is the problem.  Telling me to go through a document just to find .datasource and .datamemeber doesn't help at all.  That is pretty basic.  Either I should already know that, or you could have posted two lines.  Reguardless, I did not say how do you bind.  I had a specific question that your link in no way answered.  Sorry to bark at you, but in my experience once a few people have commented, the question just sits there.  People who go around posting half-assed answers or links just waste a lot of time.  To get around this, I have posted other questions to have a clean post.  Then I get in trouble for posting the same question again.  Again, I am not trying to give you a hard time, but I use this site as a resource, and throwing around a bunch of links ruins the resource, and wastes time for everyone.


Here is the right answer

        Dim dRow As DataRow
        dRow = m_dsLookups.Brokers.NewRow()
        dRow("Name") = ""
        dRow("GUID") = System.Guid.Empty
        m_dsLookups.Brokers.Rows.InsertAt(dRow, 0)

'this is in no way obvious, and can't be figured out from your link
        Dim cb As New DataGridViewComboBoxColumn
        cb = Me.DGBrokers.Columns("BrokerGUID")
        cb.DataSource = m_dsLookups.Brokers
        cb.DisplayMember = "Name"
        cb.ValueMember = "GUID"
0

Featured Post

DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

765 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