I got back to VB.NET after being some years abstinent to VB. Offcourse you can do everything with the designer, but.
I want to implement database functionalities by code. I have a DataGridView which will be filled like I expect. Changes will be safed, ok for now.
But I'd like to change the field which represents an foreignkey value to a dropdown field. I tried by myself and searched for a good solution, but nothing found.
This is part of my code:
.AutoGenerateColumns = True
.DataSource = TMitarbeiterBindingSource
.AutoSizeRowsMode = _
DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders
.BorderStyle = BorderStyle.Fixed3D
.EditMode = DataGridViewEditMode.EditOnEnter
There a six columns and I want the third to be a dropdown field which should use another BindingSource. Propably I have to change AutoGenerateColumns to false, but then how to add the columns manually. And after that I have to change one of the columns, but how?
If anybody would have an example that fits with my code would be helpful.
I got it, I used the following code and it works: