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:templateco lumn ItemStyle-VerticalAlign=" Top" ItemStyle-Width="117"
ItemStyle-HorizontalAlign ="left" >
<itemtemplate >
<span ><%# ((CtpRecord)Con tainer.DataItem ).Locations.Cou nt==0?"Not set":
((CtpRecord)Con tainer.DataItem ).Locations[0].LocalName%></span>
</itemtemplate>
</asp:templatecol umn>
This is a column which require some extra processing hence I use a method
declared as protected string GetFirstDocumen tOfRecord in the code behind
<asp:templateco lumn ItemStyle-VerticalAlign=" Top" ItemStyle-Width="110"
ItemStyle-HorizontalAlign ="left" >
<itemtemplate >
<span ><%# GetFirstDocumen tOfRecord((CtpR ecord)Container .DataItem)
%></span>
</itemtemplate>
</asp:templatecol umn>
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
<dl******@gmail .com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.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