MeccaIgnatius
New member
- Joined
- Jul 22, 2010
- Messages
- 1
- Programming Experience
- 10+
I was wondering if it is possible to have a default value shown in the combobox column of a dataview grid. I have tried a few ways and none seems to work. I can populate the column correctly but I need one of the items to show at the top of the list initially. For example:
ComboBox
a,
b,
c,
d are the cbobox fields in the list. I need 'a' to show when the grid is loaded at the top of the combobox as if it were selected, but without having to select this item. does this make sense? The following shows how the combobox is binded.
With grdBatchBudgetProjection -grid
With chk -combobox
.DataPropertyName = "AwardID"
.HeaderText = "Award Type"
.Width = 95
' Bind Column
.DataSource = ds3.Tables(0)
.ValueMember = "AwardId"
.DisplayMember = "AwardDesc"
.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton
'dd or cbo, doesn't really matter for this field.
End With
.Columns.Add(chk)
End With
Thanks,
Mecca
ComboBox
a,
b,
c,
d are the cbobox fields in the list. I need 'a' to show when the grid is loaded at the top of the combobox as if it were selected, but without having to select this item. does this make sense? The following shows how the combobox is binded.
With grdBatchBudgetProjection -grid
With chk -combobox
.DataPropertyName = "AwardID"
.HeaderText = "Award Type"
.Width = 95
' Bind Column
.DataSource = ds3.Tables(0)
.ValueMember = "AwardId"
.DisplayMember = "AwardDesc"
.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton
'dd or cbo, doesn't really matter for this field.
End With
.Columns.Add(chk)
End With
Thanks,
Mecca