'宣言 Public Class C1FlexPivotSlicer Inherits C1.Framework.XViewHost Implements C1.Win.FlexPivot.Design.IFlexPivotDataSource
public class C1FlexPivotSlicer : C1.Framework.XViewHost, C1.Win.FlexPivot.Design.IFlexPivotDataSource
'宣言 Public Class C1FlexPivotSlicer Inherits C1.Framework.XViewHost Implements C1.Win.FlexPivot.Design.IFlexPivotDataSource
public class C1FlexPivotSlicer : C1.Framework.XViewHost, C1.Win.FlexPivot.Design.IFlexPivotDataSource
The C1FlexPivotSlicer class help you initialize an instance of the FlexPivotSlicer control and define its behavior using the following properties:
C# |
コードのコピー
|
---|---|
private void Form1_Load(object sender, EventArgs e) { OleDbConnection con = new OleDbConnection("Provider=microsoft.jet.oledb.4.0;Data source=" + Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\ComponentOne Samples\\Common\\C1NWind.mdb"); DataTable dt = new DataTable(); new OleDbDataAdapter("Select * from Invoices", con).Fill(dt); //Configure the FlexPivotPage control c1FlexPivotPage = new FlexPivotPage(); c1FlexPivotPage.Dock = DockStyle.Fill; c1FlexPivotPage.DataSource = dt; c1FlexPivotPage.FlexPivotEngine.RowFields.Add("Country"); c1FlexPivotPage.FlexPivotEngine.ValueFields.Add("ExtendedPrice"); splitContainer1.Panel1.Controls.Add(c1FlexPivotPage); IntializeFlexPivotSlicer(); } private void IntializeFlexPivotSlicer() { //Initialize the FlexPivotSlicer control C1FlexPivotSlicer c1FlexPivotSlicer = new C1FlexPivotSlicer(); c1FlexPivotSlicer.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(c1FlexPivotSlicer); c1FlexPivotSlicer.DataSource = c1FlexPivotPage.FlexPivotPanel; //Sets the data source of the FlexPivotSlicer c1FlexPivotSlicer.Field = c1FlexPivotPage.FlexPivotEngine.Fields["Country"]; //Sets the field which should be filtered by the FlexPivotSlicer c1FlexPivotSlicer.Field.Caption = "Country Name"; //Customizes the field caption c1FlexPivotSlicer.ShowCheckBoxes = true; //Displays checkboxes next to each item in the list c1FlexPivotSlicer.MultiSelect = true; //Allows users to select multiple items from the list c1FlexPivotSlicer.ShowSelectAll = true; //Displays the Select All checkbox at the top of the list c1FlexPivotSlicer.SortOrder = System.Data.SqlClient.SortOrder.Descending; //Sorts the checklist in descending order c1FlexPivotSlicer.ShowSort = true; //Displays the Sort button in the header //Styling the FlexPivotSlicer c1FlexPivotSlicer.Styles.Common.Padding = new C1.Framework.Thickness(10); c1FlexPivotSlicer.Styles.Header.Font = new Font("Calibri", 10, FontStyle.Bold); c1FlexPivotSlicer.Styles.CheckList.Hot.BackColor = Color.LightCyan; c1FlexPivotSlicer.Styles.CheckList.HotSelected.BackColor = Color.LightPink; } |
The example instantiates the object of C1FlexPivotSlicer and shows the basic implementation with various options mentioned above.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
C1.Framework.XViewHost
C1.Win.FlexPivot.C1FlexPivotSlicer