Hi,
Is this a web or win app ?
I have done this for a web app, don't think it will work in a win app
though.
Here is the code:
You see I have to cast the DataItem to teh correct type to have access to
the properties
<asp:templatecolumn ItemStyle-VerticalAlign="Top" ItemStyle-Width="117"
ItemStyle-HorizontalAlign="left" >
<itemtemplate>
<span ><%# ((CtpRecord)Container.DataItem).Locations.Count==0 ?"Not set":
((CtpRecord)Container.DataItem).Locations[0].LocalName%></span>
</itemtemplate>
</asp:templatecolumn>
This is a column which require some extra processing hence I use a method
declared as protected string GetFirstDocumentOfRecord in the code behind
<asp:templatecolumn ItemStyle-VerticalAlign="Top" ItemStyle-Width="110"
ItemStyle-HorizontalAlign="left" >
<itemtemplate>
<span ><%# GetFirstDocumentOfRecord((CtpRecord)Container.Data Item)
%></span>
</itemtemplate>
</asp:templatecolumn>
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
<dl******@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi guys, I've been reading several topics that talk about creating a
custom collection to use it as DataSource of a Datagrid.
But the fact is I have a class called Action and another class called
Profile. In my application, the user assigns several Actions to a
Profile. I thought doing this using an ArrayList of Actions and puting
that as the DataSource of the Datagrid that shows the assignments. It
works, but it shows every property Action class have.
My two questions are:
1) how can I choose the properties of Action class I want to be
bounded?
2) does it sound reasonable? I mean the ArrayList of my custom class
Action...
Thanks in advance,
Damian