I have a a ComboBox bound to a DataSet. I would like to have combobox w开发者_StackOverflow中文版ith very first row blank. How can I do this? I've tried following
With .RoomComboBox
.DataSource = Me.aRoomsBindingSourse
.DisplayMember = "Room"
.ValueMember = "BedCode"
.DataBindings.Add("text", aRoomsBindingSourse, "Room", False,DataSourceUpdateMode.Never)
.SelectedIndex = -1
End With
Thank you in advance.
I don't think you can do this. Because .net framework doesn't allow to modify items if the DataSource set.
Hook into the post data bind event and add a row at the first location.
精彩评论