Beispiel #1
0
        /// <summary>
        /// Method to an Adjustbile Coordinate Row SET. That is each call of this method creates 2 MultiEditorRows with 3 Rows (for X/Y/Z), 2 Editor Rows which represenet Upper and Lower Range of the Adjustible
        /// Coordinate and 1 category row which houses all the above mentioned rows
        /// </summary>
        /// <param name="_name">Caption of the Category</param>
        /// <param name="mr_Upper">Multi-EditorRow which will house the Upper Range of the Adjustible Coordinate</param>
        /// <param name="mr_Lower">Multi-EditorRow which will house the Lower Range of the Adjustible Coordinate</param>
        /// <param name="er_Upper">Editor Row which will house the Upper <paramref name="mr_Upper"/></param>
        /// <param name="er_Lower">Editor Row which will house the Upper <paramref name="mr_Lower"/></param>
        /// <returns><see cref="CategoryRow"/> containing all the Rows passed as parameters</returns>
        private CategoryRow CreateRows(string _name, out MultiEditorRow mr_Upper, out MultiEditorRow mr_Lower, out EditorRow er_Upper, out EditorRow er_Lower)
        {
            ///<summary>Creating the Upper Limit's Multi-Editor Row</summary>
            mr_Upper      = new MultiEditorRow();
            mr_Upper.Name = "UpperLimit";

            MultiEditorRowProperties m1 = new MultiEditorRowProperties();

            m1.Caption = "X";
            m1.Value   = (double)0;
            MultiEditorRowProperties m2 = new MultiEditorRowProperties();

            m2.Caption = "Y";
            m2.Value   = (double)0;
            MultiEditorRowProperties m3 = new MultiEditorRowProperties();

            m3.Caption = "Z";
            m3.Value   = (double)0;

            mr_Upper.PropertiesCollection.AddRange(new MultiEditorRowProperties[] { m1, m2, m3 });
            mr_Upper.Enabled = false;



            ///<summary>Creating the Lower Limit's Multi-Editor Row</summary>
            mr_Lower      = new MultiEditorRow();
            mr_Lower.Name = "LowerLimit";

            MultiEditorRowProperties m4 = new MultiEditorRowProperties();

            m4.Caption = "X";
            m4.Value   = (double)0;
            MultiEditorRowProperties m5 = new MultiEditorRowProperties();

            m5.Caption = "Y";
            m5.Value   = (double)0;
            MultiEditorRowProperties m6 = new MultiEditorRowProperties();

            m6.Caption = "Z";
            m6.Value   = (double)0;

            mr_Lower.PropertiesCollection.AddRange(new MultiEditorRowProperties[] { m4, m5, m6 });
            mr_Lower.Enabled = false;


            ///<summary>Creating the Upper Limit's Editor Row which will house the Upper Multi-Editor Row</summary>
            er_Upper = new EditorRow();
            er_Upper.Properties.Caption   = "Upper";
            er_Upper.Properties.AllowEdit = false;
            er_Upper.ChildRows.Add(mr_Upper);
            er_Upper.Enabled = false;


            ///<summary>Creating the Lower Limit's Editor Row which will house the Lower Multi-Editor Row</summary>
            er_Lower = new EditorRow();
            er_Lower.Properties.Caption   = "Lower";
            er_Lower.Properties.AllowEdit = false;
            er_Lower.ChildRows.Add(mr_Lower);
            er_Lower.Enabled = false;


            ///<summary>The Category which will house all the above rowss</summary>
            CategoryRow category = new CategoryRow(_name);

            category.Name = _name;
            category.ChildRows.AddRange(new BaseRow[] { er_Upper, er_Lower });


            return(category);
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     this.multiEditorRowProperties1 = new DevExpress.XtraVerticalGrid.Rows.MultiEditorRowProperties();
     this.multiEditorRowProperties2 = new DevExpress.XtraVerticalGrid.Rows.MultiEditorRowProperties();
     this.vGridControl1             = new DevExpress.XtraVerticalGrid.VGridControl();
     this.customersBindingSource    = new System.Windows.Forms.BindingSource(this.components);
     this.nwindDataSet          = new WindowsApplication409.nwindDataSet();
     this.rowAddress            = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowCity               = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowCompanyName        = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowContactTitle       = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowContactName        = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowCountry            = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowFax                = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.multiEditorRow1       = new DevExpress.XtraVerticalGrid.Rows.MultiEditorRow();
     this.rowCustomerID         = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowPostalCode         = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.rowRegion             = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.simpleButton1         = new DevExpress.XtraEditors.SimpleButton();
     this.customersTableAdapter = new WindowsApplication409.nwindDataSetTableAdapters.CustomersTableAdapter();
     ((System.ComponentModel.ISupportInitialize)(this.vGridControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.customersBindingSource)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.nwindDataSet)).BeginInit();
     this.SuspendLayout();
     //
     // multiEditorRowProperties1
     //
     this.multiEditorRowProperties1.Caption   = "Company";
     this.multiEditorRowProperties1.FieldName = "CompanyName";
     //
     // multiEditorRowProperties2
     //
     this.multiEditorRowProperties2.Caption   = "Phone";
     this.multiEditorRowProperties2.FieldName = "Phone";
     //
     // vGridControl1
     //
     this.vGridControl1.DataSource     = this.customersBindingSource;
     this.vGridControl1.LayoutStyle    = DevExpress.XtraVerticalGrid.LayoutViewStyle.SingleRecordView;
     this.vGridControl1.Location       = new System.Drawing.Point(2, 12);
     this.vGridControl1.Name           = "vGridControl1";
     this.vGridControl1.RecordWidth    = 127;
     this.vGridControl1.RowHeaderWidth = 73;
     this.vGridControl1.Rows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowAddress,
         this.rowContactTitle,
         this.rowPostalCode
     });
     this.vGridControl1.ShowButtonMode = DevExpress.XtraVerticalGrid.ShowButtonModeEnum.ShowAlways;
     this.vGridControl1.Size           = new System.Drawing.Size(448, 400);
     this.vGridControl1.TabIndex       = 0;
     //
     // customersBindingSource
     //
     this.customersBindingSource.DataMember = "Customers";
     this.customersBindingSource.DataSource = this.nwindDataSet;
     //
     // nwindDataSet
     //
     this.nwindDataSet.DataSetName             = "nwindDataSet";
     this.nwindDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // rowAddress
     //
     this.rowAddress.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowCity
     });
     this.rowAddress.Height               = 16;
     this.rowAddress.Name                 = "rowAddress";
     this.rowAddress.Properties.Caption   = "Address";
     this.rowAddress.Properties.FieldName = "Address";
     //
     // rowCity
     //
     this.rowCity.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowCompanyName
     });
     this.rowCity.Name = "rowCity";
     this.rowCity.Properties.Caption   = "City";
     this.rowCity.Properties.FieldName = "City";
     //
     // rowCompanyName
     //
     this.rowCompanyName.Name = "rowCompanyName";
     this.rowCompanyName.Properties.Caption   = "CompanyName";
     this.rowCompanyName.Properties.FieldName = "CompanyName";
     //
     // rowContactTitle
     //
     this.rowContactTitle.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowContactName,
         this.rowCountry,
         this.rowCustomerID
     });
     this.rowContactTitle.Name = "rowContactTitle";
     this.rowContactTitle.Properties.Caption   = "ContactTitle";
     this.rowContactTitle.Properties.FieldName = "ContactTitle";
     //
     // rowContactName
     //
     this.rowContactName.Name = "rowContactName";
     this.rowContactName.Properties.Caption   = "ContactName";
     this.rowContactName.Properties.FieldName = "ContactName";
     //
     // rowCountry
     //
     this.rowCountry.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowFax
     });
     this.rowCountry.Name = "rowCountry";
     this.rowCountry.Properties.Caption   = "Country";
     this.rowCountry.Properties.FieldName = "Country";
     //
     // rowFax
     //
     this.rowFax.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.multiEditorRow1
     });
     this.rowFax.Name = "rowFax";
     this.rowFax.Properties.Caption   = "Fax";
     this.rowFax.Properties.FieldName = "Fax";
     //
     // multiEditorRow1
     //
     this.multiEditorRow1.Name = "multiEditorRow1";
     this.multiEditorRow1.PropertiesCollection.AddRange(new DevExpress.XtraVerticalGrid.Rows.MultiEditorRowProperties[] {
         this.multiEditorRowProperties1,
         this.multiEditorRowProperties2
     });
     //
     // rowCustomerID
     //
     this.rowCustomerID.Name = "rowCustomerID";
     this.rowCustomerID.Properties.Caption   = "CustomerID";
     this.rowCustomerID.Properties.FieldName = "CustomerID";
     //
     // rowPostalCode
     //
     this.rowPostalCode.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.rowRegion
     });
     this.rowPostalCode.Name = "rowPostalCode";
     this.rowPostalCode.Properties.Caption   = "PostalCode";
     this.rowPostalCode.Properties.FieldName = "PostalCode";
     //
     // rowRegion
     //
     this.rowRegion.Name = "rowRegion";
     this.rowRegion.Properties.Caption   = "Region";
     this.rowRegion.Properties.FieldName = "Region";
     //
     // simpleButton1
     //
     this.simpleButton1.Location = new System.Drawing.Point(160, 424);
     this.simpleButton1.Name     = "simpleButton1";
     this.simpleButton1.Size     = new System.Drawing.Size(75, 23);
     this.simpleButton1.TabIndex = 1;
     this.simpleButton1.Text     = "FindRow";
     this.simpleButton1.Click   += new System.EventHandler(this.simpleButton1_Click);
     //
     // customersTableAdapter
     //
     this.customersTableAdapter.ClearBeforeFill = true;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(515, 462);
     this.Controls.Add(this.simpleButton1);
     this.Controls.Add(this.vGridControl1);
     this.Name  = "Form1";
     this.Text  = "How to obtain a row object by FieldName in the XtraVerticalGrid";
     this.Load += new System.EventHandler(this.Form1_Load);
     ((System.ComponentModel.ISupportInitialize)(this.vGridControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.customersBindingSource)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.nwindDataSet)).EndInit();
     this.ResumeLayout(false);
 }