Hi,
You can try something like this. You need to manually remove the
column from the gridview and add the column back in. You can see a
complete example here
http://www.vb-tips.com/default.aspx?...a-62c7a184f472
Here is the code. I did not set the column the datagridview combo is bound
to. It will show the display member but keep the value member as its value.
Dim lstEnum As New List(Of enumBindTo)
Dim arColor() As String
arColor = KnownColor.GetN ames(GetType(Kn ownColor))
For x As Int16 = 0 To arColor.GetUppe rBound(0)
Dim cls As New enumBindTo
With cls
.EnumValue = x
.StringValue = arColor(x)
End With
Next
Dim dgvEnum As New DataGridViewCom boBoxColumn
With dgvEnum
.Width = 150
.DataSource = lstEnum
.ValueMember = "EnumValue"
.DisplayMember = "StringValu e"
.HeaderText = "Color"
End With
DataGridView1.C olumns.Add(dgvE num)
The class I used
Public Class enumBindTo
Private mintEnumValue As Integer
Public Property EnumValue() As Integer
Get
Return mintEnumValue
End Get
Set(ByVal value As Integer)
mintEnumValue = value
End Set
End Property
Private mstrValue As String
Public Property StringValue() As String
Get
Return mstrValue
End Get
Set(ByVal value As String)
mstrValue = value
End Set
End Property
End Class
Ken
----------------
"Brien King" <br***@classi c-soft.com> wrote in message
news:eZ******** ******@TK2MSFTN GP12.phx.gbl...
I am binding to a collection of Business Objects in a GridView (Windows
App, .NET 2.0).
In my Business Object I have a Property that is an ENUM.
I want a Drop down box in the Grid that is Bound to the property that is
of the type of the ENUM. I want the combo box filled in with the list of
ENUM values.
Does the GridView support this?
Brien King
br***@classic-soft.com