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. Image for the cookie policy date

Synchfusion GridGroupingControl painting problem

I am developing a GUI application using Synchfusion 3.2.1.0 and C#. GridGroupingControl is used for one of the screen. I want the group caption row to be hidden if there is only one record in the group. This is done using custom engine as in Samples\Grouping\ResizableRows example. It works if the datasource is pre-populated. But if I hook up real-time data, the painting is not refreshed properly once a single record group is created. For example,

group1
record1
record2

If a group2 having one record is added, the following is shown initially,

group1
g1_record1
g1_record2
group2
g2_record1

Minimize the window and restore it, the window displays

group1
g1_record1
g1_record2
g2_grecord1

which is what I want.

Thanks

Aiqun

8 Replies

AD Administrator Syncfusion Team August 16, 2006 05:19 AM UTC

Hi Aiqun,

Please refer to the following forum thread, which discuss related to this issue.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=45803

Let me know if this helps.
Thanks,
Haneef


AW Aiqun Wu August 16, 2006 03:48 PM UTC

I still could not resolve my problem after reading the thread.
Here is little sample code that demonstrate the problem. Please check to see what I am doing wrong.

I actually upgraded to 4.2 from 3.2.1. It is still a problem.

Thanks

>Hi Aiqun,

Please refer to the following forum thread, which discuss related to this issue.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=45803

Let me know if this helps.
Thanks,
Haneef

GroupingGrid.zip


AD Administrator Syncfusion Team August 17, 2006 09:11 AM UTC

Hi Aiqun,

The reason is that when the SourceList is changed ( the record is added ), it was re-initialized and the engine was not informed any thing about the condition and row height at that time. You can try checking the condition dynamically and hide the GroupCaption using GroupingEngine. Please refer the below KB article for more details.

KB : http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=363

Let me know if this helps.
Best Regards,
Haneef


AW Aiqun Wu August 17, 2006 08:52 PM UTC

Haneef,

Can you post a sample to check the condition dynamically and hide the GroupCaption using GroupingEngine? I tried not to create caption section, or play with visibleCounters, but couldn''t figure out a way to work.

Thanks

Aiqun

>Hi Aiqun,

The reason is that when the SourceList is changed ( the record is added ), it was re-initialized and the engine was not informed any thing about the condition and row height at that time. You can try checking the condition dynamically and hide the GroupCaption using GroupingEngine. Please refer the below KB article for more details.

KB : http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=363

Let me know if this helps.
Best Regards,
Haneef


AW Aiqun Wu August 17, 2006 11:08 PM UTC

Sorry, I miss the sample from kb, GGC_CustomEngineForGroupOneRow. It seems what I wanted. A quick question. Why derive from Group instead of GridGroup?

Thanks


>Haneef,

Can you post a sample to check the condition dynamically and hide the GroupCaption using GroupingEngine? I tried not to create caption section, or play with visibleCounters, but couldn''t figure out a way to work.

Thanks

Aiqun

>Hi Aiqun,

The reason is that when the SourceList is changed ( the record is added ), it was re-initialized and the engine was not informed any thing about the condition and row height at that time. You can try checking the condition dynamically and hide the GroupCaption using GroupingEngine. Please refer the below KB article for more details.

KB : http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=363

Let me know if this helps.
Best Regards,
Haneef


AW Aiqun Wu August 18, 2006 03:25 AM UTC

Haneef,

I notice a couple of problems with the approach,

1. The expand state is not preserved after new records added. It is always collapsed. Is there a way to preserve it?

2. I noticed the comments in the sample states that the custom group engine is a trimmed down version of GridGroup. I am not sure what functionality is lost, but at least the following property does not work anymore,

grid.TopLevelGroupOptions.IsExpandedInitialValue = true;

I tried to change the base class from Group to GridGroup, but it does not work (throw exception). Is there a fundamental reason not to derive from GridGroup? If so, what subset of functionality is lost?

Thanks


AW Aiqun Wu August 18, 2006 06:56 PM UTC

It looks like setting TableDirty = true caused the expand state reset. If I don''t set TableDirty to true, setting property IsExpandedInitialValue will have problem when adding a row belong to a new group.

I found a way that seems works. In OnInitializeSections function, I call SetExpanded(bool, false, false). Is it the correct way to do it?

Thanks



AD Administrator Syncfusion Team August 21, 2006 09:31 AM UTC

Hi Aiqun,

My apologies for the delay in response.

I think calling SetExpanded in OnInitailizeSections should be OK (as long as you call it after any call to the base class if you have one). OnInitializeSections is where IsExpandedInitialValue is used in our standard library.

Thanks for your patience.
Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon