Updating hierarchical DataSets isn't as simple as calling the Update or UpdateAll. Property Setting ColumnType DataGridViewComboBoxColumn DataSource. WPF Controls Controls and Libraries Data Grid Examples How to: Assign a ComboBox Editor to a Column View this topic on docs.devexpress.com ( Learn more ) How to: Assign a ComboBox Editor to a Column.
![]()
Hello: this is my first window app in .net and have been assigned to create a form that contains a datagridview.
I decided to leave it unbound, because I need it to populate in a slightly unconventional way.
I also created each column and set them as drop-downs in the designer.
I need to populate every 3rd row with a list of colors (pulled from my access db).
the row after this will always need to populate with a list of brightness values (also pulled from my access db).
Here's my code thus far:
When the form loads, I create a specified set of rows. There will always be a given amount of rows and columns..the user cannot add or remove...just edit.
After, I make a stab at populating the first row w/ colors:
It complains when after it completes this...it doesn't like the line I highlighted above in green....if I change the column index to 1, it's happy, but it doesn't put data in the first column . The main issue however, is that I need to know how to tell it to populate my dropdowns every 3rd row..(for now, just trying to get it to work on the first row).
I would sure appreciate any input at all.
thanks, proctor
Proctor, DataGridView doesn't allow to change type of Column once it defined.
you just try this code
DataGridView1.Columns.Remove(DataGridView1.Columns(0))
dim cbn as New DataGridViewComboBoxColumn With cbn .DataSource = myDS.Tables('tblColors') .DisplayMember = 'Color' .ValueMember = 'ColorId' End With DataGridView1.Columns.Insert(0, cbn)
Regards
Warun
![]() Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |