Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
104
Using Ultragrid with self-referring Business Objects
posted

Hello,

I searched the WinGrid forum for a answer to my questions but could not find a suitable one, so here´s my problem:

We currently evaluating NetAdvantage for Windows Forms and we need to know if it is working for us.
We are using NHibernate to pull data object out of the database.

So what I have is the following...

A Custom Business Object like this (self-referring example; simplified):

public class MyHierarchicalObject2
{
    BindingList<MyHierarchicalObject2> _childs = new BindingList<MyHierarchicalObject2>();
    public string Name { get; set; }
    public string Desc { get; set; }

    public BindingList<MyHierarchicalObject2> Childs
    {
        get
        {
            return _childs;
        }
    }
}

So now there seams to be a bug when using a self-referring object as datasource.

1. When I try to bind the Grid directly to this Object the Wizard will crash (silently close) hisself.


2. When I try to import the the Data Schema in the Editor (manual schema creation), it also did not work (just closing)

 

3. When I add the columns manually it is working until I set the data source programatically and opening a node.

 

How this can resolved?
I have the feeling the control is creating infinite sub-bands because of the self-referring behavior.
(this would explain the long Name column, after setting the datasource; see picture above)

Did I make some wrong configuration? Can this resolved by changing something in the MyHierachicalObject class?

I´ve done another test using a Customer / Orders relation. In this case it works flawlessly. 

You can download the test project here if you want to: http://marcux.no-ip.org/na/na_test.zip

We would be really happy if we could use your great product, but this kind of data-relation is essential for some of our program modules.

Kind regards,
Marco Röhrs
Genese.de GmbH

 

 

 

 

 





 

 

  • 37774
    posted

     I'm not sure why the MaxBandDepth property was set to a default of 100 either, but that will definitely cause a large decrease in performance in your scenario, as was mentioned.  Another issue that you might have is that there was a bug introduced in .NET 2.0 with the CurrencyManager when an object does not have any rows but has a child relation, .NET is particularly slow about calculating all relations; you could try wrapping your data source in a BindingSource to see if that helps.

    -Matt

  • 135
    Offline posted

    Hello mate,

    Think you've got forgotten about so i thought i'd help you out ...

    I had a problem like this a few weeks back and e-mailed the support staff (who are a little quicker at replying than this forum)

    The issue when using self-referring business objects is that the grid will poll through all the possible illiterations of that object, from what i gather its a seriously slow operation and hence it looks like your grid has crashed.

    Anyways the answer that was given to me was to set your MaxBandDepth property in DisplayLayout to something like 5 or 10. This means the grid doen't have to loop around so many bands and will return faster.

    This wasn't a great answer for me however and ended up using an UltraTree to solve the problem as the Grid seems hopeless at doing the scenario your trying to use it for... I'm afraid that you should also know that having spent days on a problem like yours the UltraGrid and UltraTree really arn't the best in this context. It was too late for me but i'd use another control if you can.

     Hope this helps

  • 104
    posted

    *bump*