Hide the Group Tree of a Crystal Report in WPF.


I’m using VS2010 and Crystal reports 13.
When I see any report, group tree of crystal report always show which looks bad.But i can not disable this group tree.
So i was googling but everybody suggest me to set ShowGroupTreeButton=false.But in WPF Report Viewer does not contain ToolPanelView and ShowGroupTreeButton Property.But WinForm support this.
However atleast i have found a solution and that works fine.
You can add this code in your constructor.
here is the code

var sidepanel = crystalReportsViewer.FindName("btnToggleSidePanel") as ToggleButton;
if (sidepanel != null)
   {
    crystalReportsViewer.ViewChange += (x, y) => sidepanel.IsChecked = false;
   }

If you have any query about this topic please leave a comment.

Advertisements

3 Responses to “Hide the Group Tree of a Crystal Report in WPF.”

  1. Amin Says:

    Wow…. This really helpfull…………..excellent.

    • Brij Says:

      When i click on report button 2nd or 3rd time then it will display Group Tree. Any solution?

      • refat38 Says:

        this situation i have never seen.anyway you can again add this code in your report viewer constructor.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: