.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Datagridview combobox.DroppedDown issues that require (2) clicks and not (1)

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :Windows Application

I have been reviewing following link regarding datagridview.combobox.droppeddown...the last entry is apparently not VB.NET.  Else I am missing something.


The last entry supposedly will work, however I can't come close.

Also, to expand on the issue I have is that I am attempting to click on a combobox cell at any time...whether it's the currently selected row or a different row in the gridview.  If it is a different row, that is really where I experience the problem.  I've attempted to use the following:


Private Sub dataGridView1_EditingControlShowing(ByVal sender As Object, _


ByVal e As DataGridViewEditingControlShowingEventArgs) _


View Complete Post

More Related Resource Links

Combobox in DataGridView

Hi, How do I setup a selected value for a combobox column in datagridview? Unlike a regular combobox I can't use: SelectedValue = 1; I'll give an example :Let's say I have a datagrid which is consisted of two datasets tables: one table which contains 300 entries for different types of cars, and a combobox column which contains a list of 10 car makers (that's the second table). The car maker's code is the primary key in the combobox column's value member and the foreign key in the first table. How do I load the datagrid so that t the combobox will display the correct car maker for every car entry (300 in total)? here's my current code: private void SetupDataGridView() { this.Controls.Add(carsGrid); DataGridViewComboBoxColumn comboGrid = new DataGridViewComboBoxColumn(); carsGrid.DataSource = dsCars.Tables[1]; carsGrid.DisplayMember = "CarMakerName"; carsGrid.ValueMember = "CarMakerID"; carsGrid.DataSource = dsCars.Tables[0]; carsGrid.Columns.Add(comboGrid); } Thanks, Udi

Different ComboBox in Each Row of DataGridView

Hi,   Can I have a ComboBoxColumn in a DataGridView with different items in the ComboBox of each row?   For instance, suppose there's a DataGridView in a Windows Form with rows of customer info. There's a column that shows the gender and a ComboBoxColumn to set the title. If the customer is male, the ComboBox will contain "Mr", "Dr" etc, otherwise it will have "Miss", "Mrs" etc.   How can this be done?   I saw this post but can't quite understand what it means. http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3311173&SiteID=1     Thanks, ywb

problem in make editable a combobox in datagridview in c#

how do i make my datagridview combobox aditable for the user while i has a drop down list. in this case sometimes user needs to edit the selected item from the list.how can i implement this?

DataGridView ComboBox visual style differs for same app on different systems



In a windows forms application developed with VB2008 Express the DataGridView ComboBox is rendered differently on different systems. 


On Windows XP Pro SP3, where the app was developed, the combo box appears as follows:

Well, apparently images can't be pasted to these threads so I'll have to try to describe the appearance.

Appearance in Windows XP:

Rectangular box with the same shape, color and appearance as a DataGridView TextBox except that it has a square drop-down button at it's right edge the same color as a ToolStrip or ScrollBar buttons/elevator.

Appearance in Windows 7:

Rounded rectangular gray box, lighter on the top half to make it appear bowed out along it's horizontal axis with a rectangular drop-down button, also gray.  This appearance is displeasing alongside the flat, rectangular, white background text and image boxes in the same DataGridView.

Additional information:

Salient DataGridView properties:
AutoSizeColumnsMode: None
AutoSizeRowsMode: None
BorderStyle: FixedSingle
CellBorderStyle: Single

How can I fill a Combobox in a datagridview? C#


I have made by code a datagridview. This datagridview has several comboboxes.

I want to populate this comboboxes at runtime. But I don't know how.

The code I tried:

NaardataGridView2.CurrentCell.Value = getKolommen(selVanTabellen);


getKolommen give a datatable with names. The above code doesn't work. I want something like:

NaardataGridView2.CurrentCell.DataSource = getKolommen(selVanTabellen);


Can some one help me?


Datagridview combobox


I have a bound datagridview with a combobox that is populated from another datasource.  I am trying to bind a label to the same datasource that is used in the combobox.  When the combobox selection is  changed I need the label to change with the corresponing row in the datasource.

Here is the code:



Me.CostItemsTableAdapter.FillByProjectId(Me.BuildersJobCostDatabaseDataSet.CostItems, publicCurrentProjectId)

combobox in a datagridview error


I used t his link for comboboxin a winforms datagridview.



In the designer, click on the arrow (gridview tasks) on the gridview.
I set the datasource of the grid to the appropriate dataset.
Then, click on edit columns. On this, changed one one column Type to datagridviewcomboboxcolumn.

DataPropertyName= "Vehicle"
DataSource = "VehicleDataset" - This is a different dataset which has 2 columns (ID and Name)
DisplayMember = "VehicleName"
ValueMember = "VehicleID"

This combox get teh data from a table called vehicles which has id and name. i populate them in vehicledataset.

When i load the form, i am getting a error.
I trapped the error in a datagridview_dataerror event
e.message  - Argument exception - datagrieviewcomboboxcell value is not valid.

Why i am gettign this error if i am using the value member?


Sharepoint: Health Analyzer has detected some critical issues that require attention "Severity 1"


·           I have been struggling with this issue for a few weeks, if anyone can help me resolve it, it would be so appreciated. I am currently running SharePoint 2010 Foundation on Windows Server 2008 R2. 




Sharepoint: Health Analyzer has detected some critical issues that require attention, doesn't allow


I have been struggling with this issue for many days, if anyone can help me resolve it, it would be so appreciated. I am currently running SharePoint 2010 Foundation on Windows Server 2008 R2.

I had set-up a SharePoint foundation Extranet web portal on a single server configuration (one computer) and it was functioning just fine. I moved the server to another physical location to demo it, I connected it the same way I do at my home but at this location it was on a  different internet service provider. As soon as I connected the server thru the Ethernet port to to cable modem box I immediately got a "Health Analyzer error" in the SharePoint Central Administration Window and all my ports (port 80 and 8080) were blocked.

I returned back to my home and reconnected the server computer to my home modem in the same exact way I did before (when it was functioning) and the "Health Analyzer error" in the SharePoint Central Administration Window still is displayed and all the Extranet/internet ports (port 80 and 8080) are still blocked.

I checked on the server using the "IIS manager" and the sharepoint site still functions fine on the server. Problem is I cant access it anymore from the Extranet/internet due to the ports being blocked now.

The Healt

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

AutoCompleteStringCollection for text box in DataGridView 2.0

I have been searching for a way to have autocomplete in a DataGridTextBox
object. There does not appear to be an obvious way to do this like you would
for a TextBox outside of a grid using the AutoCompleteCustomSource. Any
thoughts on how I can add this collection? :)

Sys.require + wcf svc/jsdebug


using Sys.require i do this:


however if i need to call a wcf service aka Sys.scripts.WebServices namespace.

I need to include the svc file javascript proxy after this call:
    <script src="/Modules/ShoutBox/ShoutOutService.svc/jsdebug" type="text/javascript"></script>

placing this before sys.require gives me javascript errors that certain objects don't exist yet.. since sys.require dynamically downloads javacript libraries.

is there another approach I could use o wait till all
Sys.scripts.WebServices  namespace is down before retrieving my wcf proxy classes?

I would like to not rely on "inclusion" sequence .. hoping api already exists.

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.


I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?

require Video tutorial for Composite server control and rendered server control


hi guys

i am new to forum and technology so please go easy

according to what i read from web there 3 types of custom server controls

1. composite



i found video tutorial to create and use superclass custom control in your project (extending dropdown control functionality)

i am trying to search video tutorial for other 2 types .please help me.

IE 8 Issues with Chinese/Japanese Characters


On my web application, I display information in different languages. Everything works fine in IE compatibility mode and FireFox but it shows boxes for chinese/japanese languages. I am pretty much having the same issue as described here



Thanks for your help.

How to display related tables in one crystal report and how to link this report with combobox?


Hi! I want to display a crystal report in my vb.net application. Suppose I have tables named student details, student marks, student address, etc... Now if I want to display all these details (fields of all tables) in one crystal report (with page breaks if necessary) then how will I achieve it. I will be providing a combo box in my application that contains list of student names. How can I link this combo box with the cystal report to dynamically display report for different student on selected index change of combo box? Help me friends. An example would be appreciable.

Concurrency: Tools And Techniques to Identify Concurrency Issues


Efficient parallel applications aren't born by merely running an old app on a parallel processor machine. Tuning needs to be done if you're to gain maximum benefit.

Rahul V. Patil and Boby George

MSDN Magazine June 2008

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend