﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Binding Hierarchical WebGrid to Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Binding-Hierarchical-WebGrid-to-Custom-Objects/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Binding Hierarchical WebGrid to Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Binding-Hierarchical-WebGrid-to-Custom-Objects/</link><pubDate>Tue, 04 May 2010 22:37:48 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p /&gt;&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Hi Adrian,&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;    Yes, we can define the hierarchical grid
structure in client side, however that is only for the design. With defining
the hierarchical grid in client side, we do not need to use
WebGrid1.RetrieveHierarchicalStructure() anymore since we have manually set the
structure of WebGrid.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;    However, when we use strong type custom object,
we will need to define the binding itself for the Hierarchical WebGrid in
PreInitialize server side event. In there, we will set the object relations for
the parent and child table.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;    I attached you a similar sample that my colleague
provided to you but in mine, I use a List&amp;lt;&amp;gt; custom object for the data.
Please kindly take a look and provide us with the feedbacks. Thank you and have
a nice day.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Binding Hierarchical WebGrid to Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Binding-Hierarchical-WebGrid-to-Custom-Objects/</link><pubDate>Tue, 04 May 2010 14:47:30 GMT</pubDate><dc:creator>acunningham</dc:creator><description>&lt;p&gt;Glen,&lt;/p&gt;&lt;p&gt;Is it not possible at all to:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Define the hierarchical grid structure client side&lt;/li&gt;&lt;li&gt;use the concrete collection classes e.g. CustomerCollection, OrderCollection - which impletement IHierarchicalList and IObjectRelates&lt;/li&gt;&lt;li&gt;Populate Parent collection class and all of its children&lt;/li&gt;&lt;li&gt;Then bind the grid in the IntializeDataSource method like I did earlier and have the grid display correctly.&lt;/li&gt;&lt;/ul&gt;I'm currently having issues where the grid doesn't display as hierarchial but flat.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Adrian.&lt;br /&gt;</description></item><item><title>Binding Hierarchical WebGrid to Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Binding-Hierarchical-WebGrid-to-Custom-Objects/</link><pubDate>Tue, 04 May 2010 10:46:07 GMT</pubDate><dc:creator>acunningham</dc:creator><description>&lt;p&gt;Glen,&lt;/p&gt;&lt;p&gt;Thanks for the reply, but if you look at my EDMCollection class I've actually implemented the ObjectRelations interface hence I thought I was already operating in "Inbound" mode.&lt;/p&gt;
&lt;p&gt;However, I think I have got my app working with my own implementation while referencing your &lt;em&gt;Tutorial Solution &amp;gt;&amp;gt; V4.0 &amp;gt;&amp;gt; Hierarchical_Binding.aspx &lt;/em&gt;tutorial.&lt;/p&gt;
&lt;p&gt;Code below:&lt;/p&gt;&lt;pre&gt;        protected void wgEDMPortfolios_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            List&amp;lt;BrokerEDMPortfolio&amp;gt; edmPorts2 = Controller.ServiceFacade.PortfolioNavigationService.GetBrokerEDMPortfolio(1752);&lt;br /&gt;&lt;br /&gt;                        &lt;br /&gt;            _edmColl = new EDMCollection(edmPorts2);&lt;br /&gt;            e.DataSource = _edmColl;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        protected void wgEDMPortfolios_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (!IsPostBack)&lt;br /&gt;            {&lt;br /&gt;                wgEDMPortfolios.RetrieveHierarchicalStructure();&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Binding Hierarchical WebGrid to Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Binding-Hierarchical-WebGrid-to-Custom-Objects/</link><pubDate>Tue, 04 May 2010 10:39:29 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;You are missing the obJect relations from the BindToHierchicalCustomObject.aspx sample. In your case, you will need to use the outbound mode to define the object relations as detailed in the article "Outbound Mode" in the WebGrid documentations.&lt;/p&gt;&lt;p&gt;Attached is a simple sample of outbound mode scenario using LINQ object.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Binding Hierarchical WebGrid to Custom Objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Binding-Hierarchical-WebGrid-to-Custom-Objects/</link><pubDate>Tue, 04 May 2010 08:45:23 GMT</pubDate><dc:creator>acunningham</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm using your sample from the WebGrid samples project 
"BindtoHierchicalCustomObject.aspx" however I am not using the 
ISDataSource to retrieve the data and I'm getting errors when I try to 
bind the grid.&lt;/p&gt;
&lt;p&gt;My parent collection is called "EDMCollection" and implements all the
 necessary interfaces in the same way as your sample 
"CustomerCollection" does. "EDMCollection" has elements of type "BrokerEDM"
 and a child collection of type "PortfolioCollection". 
"PortfolioCollection" has child elements of type "BrokerEDMPortfolio".&lt;/p&gt;
&lt;p&gt;I have a separate method (in a Controller class) that pulls all the data as a flat generic 
list and then pass this into the constructor of my "EDMCollection" and then use LINQ to build my EDMCollection / PortfolioCollection (Parent / Child collections) from the flat generic list passed in teh constructor.  This means EDMCollection and child PortfolioCollection is fully populated before I bind grid, but I get errors.&lt;/p&gt;
&lt;p&gt;Will this approach work?  My code is attached.&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>