views:

71

answers:

1

Hi all

I have an object which contains a number of string properties and an enum property called CRAction.

I have another object which represents a collection of the above object.

When I bind the collection object to something like a gridview, all of the string properties bind fine, but the enum doesn't appear.

I have added another string property which returns CRAction.ToString, but is there a better way to make an enum bindable to a control as part of an object?

It all seems a little hackish to have another property for the same thing purely for data binding!

A: 

This works for me:

<asp:Label> <%# DataBinder.Eval(Container.DataItem, "CRAction") %></asp:Label>
Thomas Bratt