Questions tagged [datagridviewcomboboxcell]

DataGridViewComboBoxCell allows you to select a value for the respective DataGridView cell, from the list of values (available in popup displayed). The user can select item by clicking on an item or can use arrow keys to pick up from the available list or can type a value.

196 questions
4
votes
3 answers

How to convert DataGridViewComboBoxCell to DataGridViewTextBoxCell

I searched a lot for this error many same question is already asked, but its not solving my problem. I am getting Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function. The scenario is I have…
4
votes
0 answers

DataGridViewComboBoxColumn text values not updating (integers do)

My first post, as I can't find the answer to this out there. I have a data bound GridView with a bunch of ComboBoxes. They correctly display the value from the underlying table, and the correct values appear in the drop down lists. 1 of the…
4
votes
2 answers

DataGridView autoComplete comboBox column not retaining values on initial cell leave

I have a bound dataGridView with an autoComplete combobox column and the autocomplete is working except that am observing one behaviour thats abit irritating. When i type text in the autocomplete cell for the first time and move to the next cell…
3
votes
3 answers

c# add a dgv row with a dataGridViewComboBoxCell

I'm currently trying to add a ComboBox to a dataGridView. In the DGV, there are 5 columns: checkbox, string, string, combobox, combobox. both combobox-columns are configured as datagridviewcomboboxcolumns (via VisualStudio designer). My problem is…
NoMad
  • 702
  • 2
  • 11
  • 27
3
votes
1 answer

How to set up the event Datagridviewcombobox cell selectionchanged?

I have a DataGridViewComboBoxCell control with some items into it. I would like to get the values when user chooses a value from the dropdown. I cant use DataGridViewComboBoxColumn where EditingControlShowing can be used. I need similar event…
3
votes
1 answer

How can I prevent users from entering data into DataGridViewComboBoxCells?

I have a project that uses a number of DataGridView controls. Most of the cells are of the DataGridViewTextBoxCell persuasion. I declare my controls like so: Dim MyCell as DataGridViewCell Later I specify whether they are…
Superhuman
  • 149
  • 1
  • 2
  • 13
3
votes
1 answer

C# populate DataGridViewComboBoxCell from dataset and get the selected value from database

I need to add different values from database to my DataGridViewComboBoxColumn from Table 1(id,name,...) and must have selected value(name) it. My code: SqlDataAdapter coursead = new SqlDataAdapter("select * from tbl_armycourses",…
3
votes
2 answers

existing column with Combobox in datagridview in vb.net

I am trying to put a drop down on the existing column of the DataGridView. I am filling the grid from excel source and to a specific column i need drop down. ` Dim comboBoxColumn As DataGridViewComboBoxColumn = New…
3
votes
1 answer

Datagridview comboboxcolumn different values for each row

I want to create a datagridview with comboboxcolumns using c#. The problem is that I dont know how to give different values for combobox in each row. DataTable dt = new DataTable(); dt.Columns.Add("state"); dt.Columns.Add("city"); dt.Rows.Add("a1",…
Mohammad Hammadi
  • 733
  • 2
  • 11
  • 34
3
votes
1 answer

DataGridView databinding

I give a simple example to explain what I want: I defined a class called Student, it has two properties: Name and Subjects. public class Student() { public string Name; public List Subjects; } I created two instances of Student…
3
votes
2 answers

Dynamically setting DataGridViewComboBoxCell's DataSource to filtered DataView based off of other cell selection

I have been looking high and low for a way to do the following, but to no avail. I came up with a solution that works, but am wondering if there is a better way of handling it. The Problem: I am using a DataGridView that has two…
Smitty
  • 63
  • 1
  • 1
  • 7
2
votes
1 answer

Get the SelectedItem of DataGridViewComboBoxCell VB.NET

Very good afternoon to all, The problem I have now is that I can not get the value selected as a combobox, I'm trying to set the text and value to each item in the combobox of each cell in the datagrid. My Code: CLASS MyListItem: Public Class…
John Nuñez
  • 1,780
  • 13
  • 35
  • 51
2
votes
1 answer

Custom draw of DatagridViewComboBoxColumn

I'm using a DataGridView with a DataGridViewComboBoxColumn and I need to add icons to the left of combobox items. I'm currently using EditingControlShowing event along with ComboBox.DrawItem event, like this: private void…
2
votes
0 answers

C# Combobox behaviour in Datagridview

I have a Datagridview with a column that has a combobox as editing control. Say I choose value X in the combobox in the first row. When I open the combobox in row 2 it will select value X as default (when the combobox was empty before edit), even if…
2
votes
5 answers

ComboBox added programmatically to DataGridView cell not expanding on cell click

I have a DataGridView in a C# WinForms project in which, when the user clicks on certain DGV cells, the cell changes to a DataGridViewComboBoxCell and the ComboBox is populated with some values for the user to select. Here's the form code for the…
marky
  • 4,878
  • 17
  • 59
  • 103
1
2
3
13 14