I would like to hide the "All" sections either in XAML or in the code behind. I'm not seeing any examples or posts showing how to do this. I've attached an image showing the sections I'd like to hide.In this example I've already toggled the "All" cell to be open in the LayoutLoaded event. Since that code is preventing me from collapsing it, I'd like it hidden. I don't see a Visibilty attribute on the PivotHeaderCell.Thank you.
Hello Parker,
I have been looking into your question about hiding the totals, and I can suggest you check the following forum thread which discuss a possible approach to achieve the desired design:
http://blogs.infragistics.com/forums/p/49509/274950.aspx
If you have any further questions or concerns on that matter, please do not hesitate to ask.
Hello Elena,
I am also looking for the solution "hiding the All sections". So I have checked the forum thread you mentioned here.I manage to hide the total columns but not the area marked as crossed in the image here.
I have all the rows, filters and columns area's visibility as collapsed as follows:
void pivotGrid_Loaded(object sender, RoutedEventArgs e) { pivotGrid.FiltersDropControl.Visibility = Visibility.Collapsed; pivotGrid.RowsDropControl.Visibility = Visibility.Collapsed; pivotGrid.MeasuresDropControl.Visibility = Visibility.Collapsed; pivotGrid.ColumnsDropControl.Visibility = Visibility.Collapsed; }
Any thoughts how to get this hide?
Thanks.
Sheuly
I've tried all of these strategies, either manipulating the row height or the IsVisible on the data column and all of the columns that I don't want are stil visible.
Is it because I'm expanding the data as well and this resets the row heights?
I guess I need further assistance.Thanks!
In order to hide the “All” fields I can suggest you different approaches based on your scenario, for example you can try setting the visibility of the main header cell :
pivotGrid.GridLayout.RowHeaderCells.Last().Control.Visibility = Visibility.Collapsed;
pivotGrid.GridLayout.ColumnHeaderCells.Last().Control.Visibility = Visibility.Collapsed;
Other approach that may help you achieve the desired functionality is by changing the default hierarchy that you use for every dimension as shown in the following link form our documentation:
http://help.infragistics.com/Help/NetAdvantage/WPFDV/2011.1/CLR4.0/html/xamPivotGrid_US_Defining_Hierarchies_And_Providing_Metadata_With_FlatData.html
If you still need any additional assistance on this, would you please provide me with more details about the data source that you use, or sent me a small test sample, where I can research for the more suitable way to achieve the required design.
Thanks in advance.
Maybe I'm trying to do too much in the LayoutLoaded event. I want to expand the top level "All" cell and then hide it because it's no longer needed. Setting the IsExpanded to true is working for that, but when I try to adjust the Control.Visibility for that cell the Control is still null and I get a null reference error. I’ve used the sample that’s provided in the forums for expansion, but I’m not sure why there is a “return” in the code. If you take that “return” out then you get the error that the item has already been added to the list so trying to encapsulate this is practically impossible. I’ve attached another image because maybe the first one was confusing. I didn’t have the data crossed out as well. I’ve also attached the code behind that attempts to expand the parent (All) cell and then hide it.
foreach (PivotHeaderCell cell in uxMainPivotGrid.GridLayout.ColumnHeaderCells)
{
// The top level cell has NO PARENT.
if (cell.ParentCell == null && cell.IsToggleVisible && cell.IsExpanded == false){cell.IsExpanded = true;
if (cell.Control != null){cell.Control.Visibility = Visibility.Collapsed;}
//cell.Row.Height = 0;
//cell.Row.Control.MinHeight = 0;
//cell.Row.Control.Height = 0;
//uxMainPivotGrid.UpdateLayout();
return;
}
I also tried to move the cell hiding outside of that loop and setting the control visibility hides the "All" column AND all of the Product Category labels including the data (Segment 1, Segment 2, etc.)
I'm getting closer, but I still can't hide the data rows (or columns) correctly. I check to see if it is a total row and then hide that row's control, but some other row of data is hidden. I'm assuming that the controls are reused somehow because I’m specifically hiding the “All Totals” row of data and yet the Segment 1 rows are hidden. I attached an image of what’s going on.
What I’d really like to see is the other row headings fill the available space and the same thing with the column headers.
I should add that I would also like to see this feature implemented in a future release version. With some effort, we have been able to remove the "All" hierarchy level for everything but the top level of the row dimensions, but it would be better if this entire function were easily controllable on a global level. From my perspective, the whole point of buying third party controls is that they save the individual developer time. The more that I have to "program around" a third-party control, the less valuable it becomes to me. Thank you for your time.
After some research, adding a build in functionality that hides the totals has been determined to be a new feature request. I have sent your feature request directly to our product management team. Our product team chooses new feature requests for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested features, we can plan accordingly.
If your feature is chosen for development, you will be notified at that time. Your reference number for this feature request is FR13954.
Thank you for your request.
Maybe I should escalate this into a ticket, that way I can attach sample code rather than trying to post it here. I really like the functionality of the control, but getting it to look just right seems kind of hit and miss. I'll go ahead and open a new ticket for this. Thanks!
@Todor
Can I remove the "All" levels through the control so it doesn't even make the request? When I run the SQL profiler on the communication between the control and the server I see specific requests for “All” and then those results are coming back.
@Elena
I’m using that new WCF service code that you sent me and all of that is working nicely. I just want to be able to tweak that control visually so I don’t see the redundant rows, columns and headings.
Just to be clear would you please specify the type of data source that you use- are you using Custom data provider or flat data source.