Hi
I am trying to bind a collection of objects to a Hierarchy grid. The Parent rows are the Comment objects and the Children are the Activity objects. The Comment object contains a list of Activity objects.
the code I'm trying to get working is
Thanks,
Joe
I am trying to bind a collection of objects to a Hierarchy grid. The Parent rows are the Comment objects and the Children are the Activity objects. The Comment object contains a list of Activity objects.
the code I'm trying to get working is
<telerik:RadGrid CssClass="telerikrid" ID="CommentsGrid1" runat="server" GridLines="None" Width="100%" ShowGroupPanel="False" AllowSorting="True" Skin="Windows7" OnNeedDataSource="Comments1_NeedDataSource" Font-Size="7"> <MasterTableView RetrieveAllDataFields="true" AutoGenerateColumns="False"> <DetailTables> <telerik:GridTableView> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="JdeSite" MasterKeyField="JdeSite" /> </ParentTableRelation> <Columns>
<telerik:GridBoundColumn
DataField="JdeSite"
HeaderText="Site"
/><telerik:GridBoundColumn DataField="Type" HeaderText="Type" /> <telerik:GridBoundColumn DataField="OwnerName" HeaderText="Owner" /> </Columns> </telerik:GridTableView> </DetailTables> <Columns> <telerik:GridBoundColumn DataField="JdeSite" HeaderText="Site" /> <telerik:GridBoundColumn DataField="JdeCode" HeaderText="JDE Site" /> <telerik:GridBoundColumn DataField="TradingName" HeaderText="Trading Name" /> <telerik:GridBoundColumn DataField="BookingStartDate" HeaderText="Booking Start Date" /> <telerik:GridBoundColumn DataField="BookingEndDate" HeaderText="Booking End Date" /> <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments" /> </Columns> </MasterTableView> </telerik:RadGrid>public class Comment { public string OptyRowId { get; set; } public int WeekNo { get; set; } public string JdeSite { get; set; } public string JdeCode { get; set; } public string TradingName { get; set; } public DateTime BookingStartDate { get; set; } public DateTime BookingEndDate { get; set; } public string Comments { get; set; } public List<Activity> ActivityList { get; set; } } public class Activity {
public string JdeSite { get; set; }public string Type { get; set; } public string OwnerName { get; set; } }Thanks,
Joe
