Hi there,
I have a typesafe collection in my application called Countries, which
is derived from the ReadOnlyCollectionBase. As you might guess, the
item-value is of type Country. Each Country has (for now) and ID and a
Name property.
Now I'd like to use a CheckBoxList to display the contents of my
Countries collection and let the user select some:
// chklCountries is the CheckBoxList
Countries colCountries = new Countries();
chklCountries.DataSource = colCountries;
chklCountries.DataTextField = "Name"; // Country.Name?
chklCountries.DataValueField = "ID"; // Country.ID?
chklCountries.DataBind();
There are no countries loaded at runtime eventhough the collection works
correctly. The HTML output is a funny:
<table id="chklCountries" border="0">
</table>
That's it. What am I missing?
--
/Matthias