Custom Grouping Engine and multiple ggcs on the same form

I have a custom grouping engine that the main ggc in my form uses. I have added another ggc to the form. I do not want this ggc to use this custom engine. However, I do not know how to link a ggc with a specific grouping engine.

I have this in the ctor...
GridEngineFactory.Factory = new GroupingEngineFactory();

which corrrectly applies to the first ggc, but I do not want the second ggc to use this engine. How do I go about this?

5 Replies

AD Administrator Syncfusion Team January 3, 2007 08:59 PM UTC

Hi James,

Thank you for being patience.

This can be achieved by passing the GridEngine ( Custom engine ) to the respective groupingControl. Please try the following code snippet and let us know if you need any further assistance.

>>>>>>>>>Code Snippet<<<<<<<<<
GroupingEngineFactory gf = new GroupingEngineFactory();
GridGroupingControl grid1 = new GridGroupingControl(gf.CreateEngine());
>>>>>>>>>>>>>><<<<<<<<<<<<<<

Have a nice day.

Best regards,
Madhan


AT Ankit Thakkar September 18, 2008 09:06 AM UTC

Hi,
I am using Grid Control in my application and using Custom Engine to add 2 extra sections on top of my grid. But the problem comes when custom engine is used in one form and keeping the same form open, i open one more form in my application. Somehow, it is adding extra sections in the other form even if i do not initialize the grid with custom engine in that form.

Any help would be highly appreciated...
many thanks,
Ankit

>I have a custom grouping engine that the main ggc in my form uses. I have added another ggc to the form. I do not want this ggc to use this custom engine. However, I do not know how to link a ggc with a specific grouping engine.

I have this in the ctor...
GridEngineFactory.Factory = new GroupingEngineFactory();

which corrrectly applies to the first ggc, but I do not want the second ggc to use this engine. How do I go about this?




SR SubhaSheela R Syncfusion Team September 18, 2008 09:56 AM UTC


Hi Ankit,

Thanks for your interest in Syncfusion products.

One way you can do this is to use a derived GridGroupingControl. In its default constructor, when you call the base class, pass in a new instance of your custom engine. So, only instances of this derived grid will use the custom engine, and it can be used in the designer since it has a default constructor that automatically sets up the custom engine.

Here is the code:


public class MyGridGroupingControl : GridGroupingControl
{
public MyGridGroupingControl()
: base(new MyCustomEngine())
{
//...
}
}


Please let us know if this will not serve your needs.

Regards,
Subhasheela R










AT Ankit Thakkar September 18, 2008 04:23 PM UTC

Hi,
Your code can be used for GridGroupingControl, but I am using GridControl in my screen. Can you please let me know what should I write to achieve this functionality in GridControl???

>
Hi Ankit,

Thanks for your interest in Syncfusion products.

One way you can do this is to use a derived GridGroupingControl. In its default constructor, when you call the base class, pass in a new instance of your custom engine. So, only instances of this derived grid will use the custom engine, and it can be used in the designer since it has a default constructor that automatically sets up the custom engine.

Here is the code:


public class MyGridGroupingControl : GridGroupingControl
{
public MyGridGroupingControl()
: base(new MyCustomEngine())
{
//...
}
}


Please let us know if this will not serve your needs.

Regards,
Subhasheela R












SR SubhaSheela R Syncfusion Team September 19, 2008 02:13 PM UTC


Hi Ankit,

Thanks for your update.

By design, Grid Control is not associated with any Engine collection as GridGrouping Control have. I am not sure whether you are deriving any Grid Control. If so, please upload us a minimal sample, so that I can help you easily.

Let me know with some more clear details if I am misunderstood your requirement.

Regards,
Subhasheela R





Loader.
Up arrow icon