We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

grouping grid / lazy loading Businessobject

Thread ID:

Created:

Updated:

Platform:

Replies:

71324 Jan 28,2008 03:11 AM Jan 30,2008 03:33 AM Windows Forms 4
loading
Tags: GridControl
Tobias Bendschneider
Asked On January 28, 2008 03:11 AM

Hi,

i have nested Businessobjects which load their data on demand.

For example:
My customer - contact object holds a customer object as a property. As soon as I call the "get" method of this property to get the customer object, the customer will be loaded.

Example in code:

Contact y = new Contact()
int number = y.Customer.number // At that point the customer is loaded

And here is my issue: When i bind a lst of customer-contacts to the grouping grid, automatically all customer objects are loaded, even i dont want to bind any property of the customer to that grid.

To prevent the grouping grid to auto-generate the columns of the grid, I write a method, that adds the columns I need to the grid and binds the column to the property of the customer-contact object. I have not bound any grid column to the nested customer object, but when setting the data source property of the grid, each nested customer of the list will be loaded.

I have tested this issue with the windows default data grid. If I do not bind the nested object to a column, the customer object will not be loaded!

Is there any solution for this issue?

Thanks







Tobias Bendschneider
Replied On January 29, 2008 09:50 AM

Hi,

here is a sample application wich shows my problem.

Thanks for any help!




GroupingGridSample.zip

haneefm [Syncfusion]
Replied On January 29, 2008 05:53 PM

Hi Tobias,

You can handle the QueryShowField event which affects the auto population of the FiledDescriptorCollections. It is called for each fields and let you control at runtime if a specfic fields should be added to the FiledDescriptorCollections collection. You can set e.Cancel = true to avoid speific fields being added.

this.gridGroupingControl1.Engine.ShowNestedPropertiesFields = false;
this.gridGroupingControl1.Engine.QueryShowField += new Syncfusion.Grouping.QueryShowFieldEventHandler(Engine_QueryShowField);

void Engine_QueryShowField(object sender, Syncfusion.Grouping.QueryShowFieldEventArgs e)
{
if (e.Field.Name == "ObjCustomer")
{
e.Cancel = true;
}
}

Best regards,
Haneef


Tobias Bendschneider
Replied On January 30, 2008 02:33 AM

Hey Haneef,

thank u for your help!!

regards Tobias


Fathima Shalini P [Syncfusion]
Replied On January 30, 2008 03:33 AM

Hi Tobias,

Thanks for your update.

Regards,
Fathima


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;