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
580
UltraGrid - Stop loading navigationproperties
posted

Hello!

I use Entity Framwork 4.1 / MS SQL Server 2008

When i use the following code with the normal DataGridView, i see 1 SQL-Statement in the SQL-Server-Profiler. But when i use a UltraGrid it needs 5 SQL-Statements!

private void Form1_Load(object sender, EventArgs e)
{
    Entities context = new Entities();
    this.ArtikelBindingSource.DataSource = context.WMS_Artikel.Execute(System.Data.Objects.MergeOption.AppendOnly);

    // DataGridView:  (Execute 1 SQL Command / SQL Server Profiler)
    this.DataGridView.DataSource = this.wMS_ArtikelBindingSource;

    // UltraGrid:       (Execute 5 SQL Commands / SQL Server Profiler)
    this.ultraGrid1.DisplayLayout.Bands[0].Indentation = 0;
    this.ultraGrid1.DisplayLayout.ViewStyle = Infragistics.Win.UltraWinGrid.ViewStyle.SingleBand;
    this.ultraGrid1.DataSource = this.wMS_ArtikelBindingSource;
}

The UltraGrid load all Navigationsproperties (like OrderDetails ...) too.
How can i stop this?

Thanks 4 Help!
myGil