Hi,
Can I hide XamPivotGrid areas?
p.e. how could I hide RowArea?
Regards,
Dimitris
Hi
There is properties which expose the controls in different areas of pivot grid. Below is a list of them. You can set thier Visibility property to collapsed to hide them.
xamPivotGrid.RowsDropControl.Visibility = Visibility.Collapsed; xamPivotGrid.ColumnsDropControl.Visibility = Visibility.Collapsed; xamPivotGrid.FiltersDropControl.Visibility = Visibility.Collapsed; xamPivotGrid.MeasuresDropControl.Visibility = Visibility.Collapsed;
If you want to change the layout of pivot (position of diferent areas), then you should apply new cotrol template with layout within it.
RegardsTodor
I have a XamPivotGrid and I get RowsDropControl = null
This property is initialized when the control template of grid is applied. In the life cycle of the control this happen when control becomes visible. So you should fine the appropriated place where to call this code.
My suggestion is to do this in loaded event of the window where the pivot grid resides.
Below is snippet of constructor of MainWindow class.
public MainWindow()
{
this.Loaded += (s, e) =>
xamPivotGrid.RowsDropControl.Visibility = Visibility.Collapsed;
};
InitializeComponent();
}
I try this code:
xamPivotGrid.FiltersDropControl.Visibility = Visibility.Collapsed;
but in my PivotGrid, the FiltersDropControl is null and show error.how i hide filter in XamPivotDataSelector?
Thanks, Gomes
I ended up using the OnLayoutUpdated event and the various Drop controls were not null and could be collapsed in that event. Just remember that this can be called quite a few times (and not just once like the OnLoaded event).
I tried the same thing that nharake did and put the code in both OnLoaded events and the controls are still null. I tried the OnLoaded of the containing UserControl and in the xamPivotGrid. The MeasuresDropControl was null as well as quite a few others.
thanks alot,
can i know when is the release of the 11.2?
I saw you use Silverlight 5. We have not built and tested the control against this version of SL. I am sure this is the reason you get null element data
Todor
Well as far as i know, i dont think so
am trying to hide the area where it says:Drop filter fields here, msval, and sDate
plz find attached the code for clarification