Questions tagged [datagridcomboboxcolumn]

1

votes
0

answer
6

Views

Is there a way to remove the selection line(highlighted) in a databound combox on a datagridview?

I am having trouble with a databound datagridviewcomboboxcell I want to remove the blue selection line that appears on a databound comboboxcell. I noticed that if a comboboxcell is not databound but has a collection of items, the blue line does not appear. however a databound combobox does have it....
Stuart Black
1

votes
0

answer
18

Views

Why does Binding on DataGridComboBoxColumn not adhere to UpdateSourceTrigger from Selector.SelectedItemProperty

Selector.SelectedItemProperty is using UpdateSourceTrigger.Default, which results in PropertyChanged, and this works fine when using a combobox on any control like this: This will result in a two-way binding with UpdateSourceTrigger=PropertyChanged. However when applying that same binding on a DataG...
sondergard
1

votes
3

answer
920

Views

WPF: Binding DataGrid to a list<Product> having a DataGridComboBoxColumn bound to a list<Category>?

I have a DataGrid with ItemsSource set to a list of products and I have a DataGridComboBoxColumn inside the DataGrid with ItemsSource set to a list of categories. That way I want the user to choose a certain category for each product. I always get the binding error: BindingExpression path error: 'C...
msfanboy
1

votes
2

answer
916

Views

In a WPF DataGrid with DataView behind we want to show a ComboBox as a Label until clicked

So we have a WPF DataGrid with some ComboBoxes in some of the cells where there is a foreign relation, but this means we have hundreds of ComboBoxes loaded at a time which takes too long. What we would like to do is load a label until it is clicked on at which point a ComboBox is loaded, we can easi...
Fugu
1

votes
1

answer
2.6k

Views

Dynamic ComboBox in a DataGridView

I have a DataGridView with 4 columns, one of them being a drop-down (ComboBox) column. The values in this column must be distinct so once a given drop-down values is selected in a row, I'd like it to not be available in any of the drop-downs in other rows. If a given value is unselected it should...
R0MANARMY
1

votes
2

answer
1.4k

Views

Disabling/Making read only all combobox in one column in datagrid

My grid is getting bound correctly all I have to do is disable or make it readonly all the combobox contained in the Column2 based on any condition from code behind. suppose after the grid is rendered we get 10 rows containing this comboxbox. I have to disable the combobox column in all these 10 row...
Jason
1

votes
1

answer
5.6k

Views

DataGridViewComboBoxColumn Selected Value

I have created a database in MS Access that I am porting over to VB.NET. I'm doing most of the work in code. I have a continuous SubForm that contains a combobox that is filled with values from a Table (tblSubject). It has a key column and a value column. tblSubject SubjectID (PK) | Subject It is li...
Alex Hedley
1

votes
1

answer
644

Views

How to get selection from ComboboxColumn in specific row?

I don't know how to properly return value from ComboboxColumn cell after selection. My ComboboxColum looks like this: ItemsSource is set in the code behind as list of Person objects. Now, how I can get list of Person objects made from all selections in this column? I tried to make new list of Person...
user3146472
1

votes
2

answer
265

Views

How can I use different properties for the dropdown and the cell contents of a DataGridComboBoxColumn?

I have the following class: public class Zone { public int ID {get;set;} public string Name {get;set;} public string Formatted {get;set;} } with the following DataGridComboBoxColumn: and I am using a List as the ItemsSource of a DataGridComboBoxColumn: ((DataGridComboBoxColumn)dg.Columns[0]).ItemsSo...
Zev Spitz
1

votes
3

answer
2.6k

Views

How to populate a DataGridViewCombobBoxColumn with values

I am using a DataGridView in a C# WinForms application and want to let the user choose between a set of values that will be the same in each cell. I suppose there needs to be a way to populate all the cells with a list of values. Using the GUI designer, I have added COL_BUSINESS_INDUSTRY, which is a...
Vlad Schnakovszki
1

votes
1

answer
1.2k

Views

Easy way to specify Enum type as DataGridComboboxColumn ItemsSource (using DataGrid.Resources is too verbose)?

I know I can bind DataGridComboboxColumn's ItemsSource to enum members like this: ... The question is: Is there a faster (not so verbose) way?
nightcoder
1

votes
1

answer
725

Views

Check if DataGridViewComboBox is empty

I have a datagridview with a combobox column that is bound to an enum as follows: var D = (DataGridViewComboBoxColumn)dgvInputs.Columns[2]; D.ValueType = typeof(MyType); D.ValueMember = 'Value'; D.DisplayMember = 'Display'; D.DataSource = new MyType[] { MyType.Rev, MyType.Model, MyType.User, MyType....
Paul Sinclair
1

votes
1

answer
531

Views

DataGridComboBoxColumn is empty

My DataGridComboBoxColumn does not show any data. It's empty. I have no problem to fill a ComboBox, but DataGridComboBoxColumn doesn't work. .NetFramework 4.6.1 Model: public class Address { public string Firstname { get; set; } public string Lastname { get; set; } public string Country { get; set;...
PeRa
1

votes
1

answer
90

Views

DataGrid DataGridComboBoxColumn lose its value after collapsing

I have a GridView whith DataGridComboBoxColumn, it works fine the first time, but when set the column visibility to collapsed, and then return the visibility to visible again, the column lose its value. but the property which is bounded to it still has the correct value. when refresh the DataContext...
IBRA
1

votes
1

answer
0

Views

How to create combobox cell with DisplayStyle ComboBoxList?

I have datagridview and column with cells DataGridViewComboboxCell. DisplayStyle is set as Nothing. When I start typing in this cell changes its style to combobox. And I cannot provide my tekst, because cell search item according to text providing by me. I want to change its style to comboboxlist as...
Robert
1

votes
1

answer
3k

Views

Bind a multicolumn devexpress combobox that is inside a gridview

So I have a Dev Express gridview that is being bound to its data source in the cod behind. This data source is just a regular ORM object and it is working fine. I am trying to get one of the columns to turn into a combobox when I hit edit on the record. So far I have been able to accomplish this wit...
ledgeJumper
1

votes
1

answer
974

Views

Data binding 15,000 items in a combobox is too slow

So as the title suggests, I have about 15,000 items and I'm trying to bind them to a ComboBox. well I have a data grid and I tried using a DataGridComboBoxColumn which was slow so I switched to a DataGridTemplateColumn using DataTemplates but it's not any faster. I've been searching online for a lon...
user2013535
1

votes
1

answer
1.2k

Views

How to bind two dependant ComboBoxes in a DataGrid

I've a problem with the WPF datagrid. I have two ComboBox columns and the second one should set it's datacontext dependant of what is selected in the first one. ViewModel public class MyCollection: AbstractViewModel { private BindingList _subitems; public BindingList Subitems { get { return _subitem...
Mighty Badaboom
1

votes
1

answer
2.7k

Views

DataGridComboBoxColumn binding to List<Enum>

I want to bind a list of enum values to a 'DataGridComboBoxColumn'. I've tried a lot, but nothing really works. Here is what I have: viewmodel-class: public class ViewModel { public ViewModel() { TestCollection= new ObservableCollection(); AnyClasses = new ObservableCollection(); //... fill AnyClas...
CodeCannibal
1

votes
2

answer
570

Views

DataGridComboBoxColumn wont display selected item in cell on ending edit

I'm having an issue when I select an item from a DataGridComboBoxColumn. The cell wont display the name of the item I've chosen after I move focus to the next cell. This is the code I have: DataGridComboBoxColumn cb1 = new DataGridComboBoxColumn(); cb1.ItemsSource = listOStrings; cb1.TextBinding =...
user2748943
1

votes
2

answer
74

Views

How to handle event of combobox in datagridview?

I have a checkbox[All] and a datagridview as below: I would like: The inside datagridview, if all checkbox is checked, the checkbox[All] is checked and otherwise if all checkbox is unchecked, the checkbox[All] is unchecked The inside datagridview, there is a checkbox that is unchecked, the checkbox[...
MinhKiyo
1

votes
2

answer
1.8k

Views

WPF DataGrid - Dynamically Bind DataGridComboBoxColumn based on row

I have an ObservableCollection of objects. These object are displayed in a DataGrid & a `SelectedObject I have a property PossibleParentObjects that returns a List of Objects based on the SelectedObject. I would like to have this property populate a ComboBox residing in a column of the DataGrid How...
Anthony Nichols
17

votes
3

answer
21.2k

Views

How to implement editable DataGridComboBoxColumn in WPF DataGrid

I want to enable the user to edit some data in WPF DataGrid ( from the .net Framework 4.0). The 'instruments' column should allow the user to select an available intrument from a static list or to write a free text. My DataGrid is binded to data using MVVM. I've tried many solutions I've found in in...
Alexander Zwitbaum
2

votes
1

answer
711

Views
4

votes
1

answer
627

Views

C# creating 2 rows, the first one is a text view list and the second is a comb box list

My project is a C# application to import data from an excel sheet to the database and prompt the user to map them manually. I need to create two rows: The first row is a DataGridTextColumn where the excel's headers fit to. The second row is a DataGridComboBoxColumn having the column_name of the data...
Salwa Najm
5

votes
3

answer
1.4k

Views

DataGridComboBoxColumn different ItemsSource for different rows

Here the question similar to my question is asked, but I did not find the solution there. My Question : How to bind different data(say Lists) to the 'DataGridComboBoxColumn' for each ComboBox in a different rows. Here is the code I tried XAML: .cs using System.Collections.ObjectModel; // For Observ...
Gopi
11

votes
5

answer
36.1k

Views

WPF DataGrid: DataGridComboxBox ItemsSource Binding to a Collection of Collections

Situation: I've created a DataGrid in XAML and the ItemsSource is binded to an ObservableCollection of a certain class that contains properties. Then in C#, I create a DataGridTextColumn and a DataGridComboBoxColumn and binded these to the properties of the objects inside the ObservableCollection. I...
4

votes
2

answer
5.8k

Views

Binding to DataGridComboBoxColumn from collection

Trying to bind to a collection in WPF, I got the following to work: XAML: CS: namespace DataGrid { /// /// Interaction logic for Window1.xaml /// public partial class Window1 { private readonly ObservableCollection personList = new ObservableCollection(); public Window1() { InitializeComponent();...
baron
4

votes
1

answer
4.6k

Views

WPF DataGridComboBoxColumn`s ComboBox is only visible when DataGrid has IsReadOnly=FALSE

Why is the ComboBox in that column only visible via double-click in the empty cell when the DataGrid is set to IsReadOnly = FALSE ??? using a DataTemplateColumn works as always... whats wrong with that DataGridComboBoxColumn? works:
msfanboy
5

votes
1

answer
4.4k

Views

WPF: Databinding with DataGridComboBoxColumn

This is what I want: There is a combo-box column bound to the ApplicationKey property of ClassA The combo-box is populated with ApplicationTokens from a static function all. An ApplicationToken has a ApplicationName and ApplicationKey property When an item is selected in the drop-down, the ClassA.Ap...
Jonathan Allen
2

votes
1

answer
1.1k

Views

How to force editing of a DataGridComboBoxColumn?

I can expose a DataGridComboBoxColumn on a grid, but the user must click it twice to show its drop-down list (the first is to gain focus and enter in edit-mode). How can I force programatically to show the drop-down list?
3

votes
1

answer
1.8k

Views

sorting in DataGridComboBoxColumn in datagrid in wpf

I have datagrid which is having 1 of the column as DataGridComboBoxColumn. Displaying of existing data, binding of itemsource, updating source when selection changes is working fine. The problem is when i click on the header of the DataGridComboBoxColumn it is not sorting alphabetically. When I ch...
samar
6

votes
1

answer
2.7k

Views

DataGridComboBoxColumn loses its content when selection changes

When I click a cell in my DataGridComboBoxColumn the ComboBox gets visible and I can select items. When I have selected an item its visible at the top thats fine. But when the cell aka ComboBox loses its focus because I click something different in the DataGrid then there is no item/text visible any...
msfanboy
3

votes
3

answer
3.7k

Views

How do I implement a multicolumn ComboBox DataGridColumn in a WPF DataGrid?

I have a simple question that I assume does not have a simple solution. I need to have a multi-column ComboBox for some grid columns in my WPF DataGrid. Is there a known best-practice to accomplish this? From what I have gathered this will require subclassing the DataGridComboBoxColumn to support...
Justin Horner
2

votes
2

answer
1.6k

Views

How can DataGridComboBoxColumn style be changed?

I need to change border style to invisible on 'DataGridComboBoxColumn'... How can I do it? I hope there is another way then changing to datagridTemplate and put combobox element with my style inside....
Tom
4

votes
2

answer
7.9k

Views

show some static values in wpf datagrid combobox column

I am trying to use a DataGrid whose first column is a ComboxBox. This ComboxBox has a hardcoded static values, possible values are: Employee, Contractor, Supplier How can I show some static values in the DataGrid without binding to a DataSource. I am new to WPF so more detailed explanation would hel...
VNarasimhaM
2

votes
1

answer
2.3k

Views

Change DatagridviewTextBox Text When DatagridviewComboBox Selected Index Changes

In My DatagridView,I Have Two Columns, ComboxboxColumn and TextboxColumn. I want to change the value of textbox when combobox selected index changes (in general combobox it has selected index change event but datagridviewComboBox does not have it)
Arash
1

votes
2

answer
1.7k

Views

CollectionViewSource Not Updating with PropertyChanged

I'm having an enormous amount of trouble with ComboBoxes in a data grid. And really would like some help, i think i've gotten confused by the amount of research and things i've tried. This really should be simple so i must be missing something. SIMPLIFIED PROBLEM I use a CollectionViewSource in xaml...
Asvaldr
5

votes
2

answer
3.2k

Views

ElementStyle error for DataGridComboBoxColumn in WPF

I'm trying to alter the ElementStyle of a DataGrid ComboBox column. Supposedly the Style is really of type TextBlock when the control is not being edited. So as shown in other examples, I've tried: When this is embedded in my DataGridComboBoxColumn definition, I get this weird error message: 'Text...
Tekito
2

votes
1

answer
1.6k

Views

Binding WPF DataGridComboBoxColumn with MVVM (WAF)

Help me to solve binding problem. The poject is in WPF + WAF + ef code first. I want to bind DataGridComboBoxColumn value to models property, but something not working. Models: public class DocumentMove { [Key] public Guid DocumentMoveId { get; set; } public Guid RawMaterialId { get; set; } public R...
Daler

View additional questions