Hmm, I've experimented a bit with this thing again...
As I add a new column to a DataSet bound to a DataGridView, it leads to
automatic addition of one TextBox column into the DataGridView. After using
DataGridViewCell cell = new DataGridViewComboBoxCell();
DGV.Columns["colname"].CellTemplate = cell;
I encounter an error message "Value for the property CellTemplate has to
be of the Windows.Forms.DataGridViewTextBoxCell type or has to be
derived from this type." (I'm sorry for the translation, but the
original error message was not in English)
I wonder, am I able to change the column type upon it's automatic
creation? I guess not. How could I change the column type then? I should
definitely not add any new columns to the DataGridView as I'd have two
brand new columns instead of one then...
Maybe I could still create the column myself, remove the automatically
created one and set the data binding, but that doesn't seem to me as a
good solution. There must be a simple way how to do this...
Any ideas?
With regards
nvx
nvx napsal(a):