Solved

how do I get a listbox to show up in one column of a datagridview control in vb.net

Posted on 2013-02-03
6
370 Views
Last Modified: 2013-02-04
every thing I read, it says to go to the datagridview properties
listbox details and add a listbox

I can find no such property.

using visual studio 2010.
made all of the columns, want the second column to have a dropdown list with three words in it.
do I have to add something to the project or to the properties or make my own datagrid with this type of property?
thanks gary
0
Comment
Question by:javagair
  • 4
  • 2
6 Comments
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 38849436
There is no ListBox In datagridview ..You can Add a ComboBox Column instead..and change ComboBox Dipslay style...
0
 
LVL 18

Accepted Solution

by:
John (Yiannis) Toutountzoglou earned 500 total points
ID: 38849441
In the DatagridView Tasks select your ComboBox Column in the Data Section You Will see "Items" ..There you can add Line by line whatever you want....

BTW how you populate your dategridview....Did you create it Dynamically or Draged to the form from a dataset?
0
 

Author Comment

by:javagair
ID: 38849903
actually it is blank.  the datagrid will fill in with a row for everyday of the current month. if then if there are no matching dates from a sql search of the database the user can fill in information for each day.  If there are already days filled in for the month they will then populate the datagrid and the user will fill in any missing day's information.

Funny things is that when I looked on multiple programing sites they all mention using the list box, some even have pictures of using it but they all claim there is a listbox bind in the property box.

will try the item list.

gary
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 38850018
Here is a sample
http://www.codeproject.com/Articles/24180/DataGridView-Control-with-ListBox

Also could you give an example for that you say
"looked on multiple programing sites they all mention using the list box.....
maybe these are 'third Party components..
0
 

Author Comment

by:javagair
ID: 38850362
You are right, places I was looking showed picture from the above codeproject and I just made an assumption that I was doing something wrong.

Your solution works great, I just had never used the control before and didn't drop the listbox down for the column.

thanks

gary
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 38850719
Glad i Helped you ..


John
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
Crystal reports vb.net 2 54
Visual Studios 1 76
Open a link in vb.net 2 15
DataGridView / get bound table name? 8 24
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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