P
Pete Nelson
Does anyone know of a way to bind a string collection to a datagrid?
Basically, I have an object, CreditPlans, and a string collection,
ModelNumbers. I'd like to bind the ModelNumbers collection to the
datagrid, but because there isn't a custom object with properties, just
a string object, I'm not sure how to reference it in the datagrid.
FYI, I can enumerate through the collection...
foreach(string modelNum in CreditPlan.ModelNumbers)
{
// code
}
But I'm not sure what would go in the datagrid....
<aspataGrid Runat="server" ID="dgModels" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="???"/>
</Columns>
</aspataGrid>
Any ideas? I can always create a custom ModelNumber object, but I'd
like to avoid it if I can.
--
===============================================================
Pete "DVDTracker" Nelson | When the barrel of my Glock
(e-mail address removed) | meets Hoppes #9, it's like
www.ecis.com/~weasel | a long-lost family reunion.
===============================================================
Basically, I have an object, CreditPlans, and a string collection,
ModelNumbers. I'd like to bind the ModelNumbers collection to the
datagrid, but because there isn't a custom object with properties, just
a string object, I'm not sure how to reference it in the datagrid.
FYI, I can enumerate through the collection...
foreach(string modelNum in CreditPlan.ModelNumbers)
{
// code
}
But I'm not sure what would go in the datagrid....
<aspataGrid Runat="server" ID="dgModels" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="???"/>
</Columns>
</aspataGrid>
Any ideas? I can always create a custom ModelNumber object, but I'd
like to avoid it if I can.
--
===============================================================
Pete "DVDTracker" Nelson | When the barrel of my Glock
(e-mail address removed) | meets Hoppes #9, it's like
www.ecis.com/~weasel | a long-lost family reunion.
===============================================================