iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
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.
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".
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.
Will this approach work? My code is attached.
Hi Adrian,
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.
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.
I attached you a similar sample that my colleague provided to you but in mine, I use a List<> custom object for the data. Please kindly take a look and provide us with the feedbacks. Thank you and have a nice day.
Best Regards,
Andi Santoso
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.
Attached is a simple sample of outbound mode scenario using LINQ object.
Glen,
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.
However, I think I have got my app working with my own implementation while referencing your Tutorial Solution >> V4.0 >> Hierarchical_Binding.aspx tutorial.
Code below:
protected void wgEDMPortfolios_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e) { List<BrokerEDMPortfolio> edmPorts2 = Controller.ServiceFacade.PortfolioNavigationService.GetBrokerEDMPortfolio(1752); _edmColl = new EDMCollection(edmPorts2); e.DataSource = _edmColl; } protected void wgEDMPortfolios_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e) { if (!IsPostBack) { wgEDMPortfolios.RetrieveHierarchicalStructure(); } }
Is it not possible at all to:
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname