Devexpress pivotgrid 自定义 CustomizationFormStyle
Devexpress pivotgrid Customization CustomizationFormStyle
我在自定义表单中显示字段。我选择 Excel2007
作为 CustomizationFormStyle
但我只想显示 Filter
区域。我希望 Column
、Row
和 Data
区域不可见。
我该如何管理?
pivotGridControl1.OptionsCustomization.CustomizationFormStyle = DevExpress.XtraPivotGrid.Customization.CustomizationFormStyle.Excel2007;
pivotGridControl1.OptionsCustomization.CustomizationFormLayout = CustomizationFormLayout.BottomPanelOnly1by4;
pivotGridControl1.OptionsCustomization.CustomizationFormAllowedLayouts = CustomizationFormAllowedLayouts.BottomPanelOnly1by4;
您需要使用PivotGridControl.ShowingCustomizationForm
event and PivotGridControl.ShowCustomizationForm
event. In PivotGridControl.ShowingCustomizationForm
event you need to get CustomizationForm
object from CustomizationFormShowingEventArgs.CustomizationForm
属性 并在PivotGridControl.ShowCustomizationForm
事件中使用此对象来自定义自定义表单。要获取过滤区域和其他区域对象,需要使用 CustomizationForm.BottomPanel
属性 及其 GetAreaLabel
、GetAreaIcon
和 GetAreaList
方法。
这是示例:
private void pivotGridControl1_ShowingCustomizationForm(object sender, CustomizationFormShowingEventArgs e)
{
_customizationForm = e.CustomizationForm as CustomizationForm;
}
private void pivotGridControl1_ShowCustomizationForm(object sender, EventArgs e)
{
var bottomPanel = _customizationForm.BottomPanel as ExcelCustomizationFormBottomPanel;
var areas = new PivotArea[] { PivotArea.ColumnArea, PivotArea.RowArea, PivotArea.DataArea };
foreach (var area in areas)
{
bottomPanel.GetAreaLabel(area).Hide();
bottomPanel.GetAreaIcon(area).Hide();
bottomPanel.GetAreaList(area).Hide();
}
var filterAreaList = bottomPanel.GetAreaList(PivotArea.FilterArea);
var dataAreaList = bottomPanel.GetAreaList(PivotArea.DataArea);
filterAreaList.Height = dataAreaList.Bottom - filterAreaList.Top;
}
我在自定义表单中显示字段。我选择 Excel2007
作为 CustomizationFormStyle
但我只想显示 Filter
区域。我希望 Column
、Row
和 Data
区域不可见。
我该如何管理?
pivotGridControl1.OptionsCustomization.CustomizationFormStyle = DevExpress.XtraPivotGrid.Customization.CustomizationFormStyle.Excel2007;
pivotGridControl1.OptionsCustomization.CustomizationFormLayout = CustomizationFormLayout.BottomPanelOnly1by4;
pivotGridControl1.OptionsCustomization.CustomizationFormAllowedLayouts = CustomizationFormAllowedLayouts.BottomPanelOnly1by4;
您需要使用PivotGridControl.ShowingCustomizationForm
event and PivotGridControl.ShowCustomizationForm
event. In PivotGridControl.ShowingCustomizationForm
event you need to get CustomizationForm
object from CustomizationFormShowingEventArgs.CustomizationForm
属性 并在PivotGridControl.ShowCustomizationForm
事件中使用此对象来自定义自定义表单。要获取过滤区域和其他区域对象,需要使用 CustomizationForm.BottomPanel
属性 及其 GetAreaLabel
、GetAreaIcon
和 GetAreaList
方法。
这是示例:
private void pivotGridControl1_ShowingCustomizationForm(object sender, CustomizationFormShowingEventArgs e)
{
_customizationForm = e.CustomizationForm as CustomizationForm;
}
private void pivotGridControl1_ShowCustomizationForm(object sender, EventArgs e)
{
var bottomPanel = _customizationForm.BottomPanel as ExcelCustomizationFormBottomPanel;
var areas = new PivotArea[] { PivotArea.ColumnArea, PivotArea.RowArea, PivotArea.DataArea };
foreach (var area in areas)
{
bottomPanel.GetAreaLabel(area).Hide();
bottomPanel.GetAreaIcon(area).Hide();
bottomPanel.GetAreaList(area).Hide();
}
var filterAreaList = bottomPanel.GetAreaList(PivotArea.FilterArea);
var dataAreaList = bottomPanel.GetAreaList(PivotArea.DataArea);
filterAreaList.Height = dataAreaList.Bottom - filterAreaList.Top;
}