コード例 #1
0
ファイル: frmSample3.cs プロジェクト: eglrp/TESTPROJECT-1
        private void frmSample3_Load(object sender, System.EventArgs e)
        {
            grid.Redim(46, 3);

            SourceGrid2.VisualModels.Common l_TitleModel = new SourceGrid2.VisualModels.Common(false);
            l_TitleModel.BackColor     = Color.SteelBlue;
            l_TitleModel.ForeColor     = Color.White;
            l_TitleModel.TextAlignment = ContentAlignment.MiddleCenter;
            SourceGrid2.VisualModels.Common l_CaptionModel = new SourceGrid2.VisualModels.Common(false);
            l_CaptionModel.BackColor = grid.BackColor;

            int l_CurrentRow = 0;

            #region Base Types
            grid[l_CurrentRow, 0]            = new Cells.Cell("Base Types", null, l_TitleModel);
            grid[l_CurrentRow, 0].ColumnSpan = 3;
            l_CurrentRow++;

            //string
            grid[l_CurrentRow, 0] = new Cells.Cell("String", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell("String Value", typeof(string));

            l_CurrentRow++;

            //double
            grid[l_CurrentRow, 0] = new Cells.Cell("Double", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(1.5, typeof(double));

            l_CurrentRow++;

            //int
            grid[l_CurrentRow, 0] = new Cells.Cell("Int", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(5, typeof(int));

            l_CurrentRow++;

            //DateTime
            grid[l_CurrentRow, 0] = new Cells.Cell("DateTime", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(DateTime.Now, typeof(DateTime));

            l_CurrentRow++;

            //Boolean
            grid[l_CurrentRow, 0] = new Cells.Cell("Boolean", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(true, typeof(Boolean));

            l_CurrentRow++;
            #endregion

            #region Complex Types
            grid[l_CurrentRow, 0]            = new Cells.Cell("Complex Types", null, l_TitleModel);
            grid[l_CurrentRow, 0].ColumnSpan = 3;
            l_CurrentRow++;

            //Font
            grid[l_CurrentRow, 0] = new Cells.Cell("Font", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell(this.Font, typeof(Font));

            l_CurrentRow++;

            //Cursor
            grid[l_CurrentRow, 0] = new Cells.Cell("Cursor", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell(Cursors.Arrow, typeof(Cursor));

            l_CurrentRow++;

            //Point
            grid[l_CurrentRow, 0] = new Cells.Cell("Point", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell(new Point(2, 3), typeof(Point));

            l_CurrentRow++;

            //Rectangle
            grid[l_CurrentRow, 0] = new Cells.Cell("Rectangle", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell(new Rectangle(100, 100, 200, 200), typeof(Rectangle));

            l_CurrentRow++;

            //Image
            grid[l_CurrentRow, 0] = new Cells.Cell("Image", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell(null, typeof(Image));

            l_CurrentRow++;

            //Enum AnchorStyle
            grid[l_CurrentRow, 0] = new Cells.Cell("AnchorStyle", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell(AnchorStyles.Bottom, typeof(AnchorStyles));

            l_CurrentRow++;

            //Enum
            grid[l_CurrentRow, 0] = new Cells.Cell("Enum", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(System.Windows.Forms.BorderStyle.Fixed3D, typeof(System.Windows.Forms.BorderStyle));

            l_CurrentRow++;
            #endregion

            #region Special Editors and Cells
            grid[l_CurrentRow, 0]            = new Cells.Cell("Special Editors and Cells", null, l_TitleModel);
            grid[l_CurrentRow, 0].ColumnSpan = 3;
            l_CurrentRow++;

            //Double Chars Validation
            grid[l_CurrentRow, 0] = new Cells.Cell("Double Chars Validation", null, l_CaptionModel);
            SourceGrid2.DataModels.EditorTextBoxNumeric l_NumericEditor = new SourceGrid2.DataModels.EditorTextBoxNumeric(typeof(double));
            l_NumericEditor.NumericCharStyle = SourceLibrary.Windows.Forms.NumericCharStyle.DecimalSeparator | SourceLibrary.Windows.Forms.NumericCharStyle.NegativeSymbol;
            grid[l_CurrentRow, 1]            = new Cells.Cell(0.5, l_NumericEditor);

            l_CurrentRow++;

            //String Chars (ABC)
            grid[l_CurrentRow, 0] = new Cells.Cell("String Chars Validation(only ABC)", null, l_CaptionModel);
            SourceGrid2.DataModels.EditorTextBox l_StringEditor = new SourceGrid2.DataModels.EditorTextBox(typeof(string));
            l_StringEditor.ValidCharacters = new char[] { 'A', 'B', 'C' };
            grid[l_CurrentRow, 1]          = new Cells.Cell("AABB", l_StringEditor);

            l_CurrentRow++;

            //Int 0-100 or null
            grid[l_CurrentRow, 0] = new Cells.Cell("Int 0-100 or null", null, l_CaptionModel);
            SourceGrid2.DataModels.EditorTextBoxNumeric l_NumericEditor0_100 = new SourceGrid2.DataModels.EditorTextBoxNumeric(typeof(int));
            l_NumericEditor0_100.NumericCharStyle = SourceLibrary.Windows.Forms.NumericCharStyle.None;
            l_NumericEditor0_100.MinimumValue     = 0;
            l_NumericEditor0_100.MaximumValue     = 100;
            l_NumericEditor0_100.AllowNull        = true;
            grid[l_CurrentRow, 1] = new Cells.Cell(7, l_NumericEditor0_100);

            l_CurrentRow++;

            //Enum Custom Display
            grid[l_CurrentRow, 0] = new Cells.Cell("Enum Custom Display", null, l_CaptionModel);
            SourceGrid2.DataModels.EditorComboBox l_KeysCombo = new SourceGrid2.DataModels.EditorComboBox(typeof(Keys));
            l_KeysCombo.ConvertingValueToDisplayString += new SourceLibrary.ComponentModel.ConvertingObjectEventHandler(l_KeysCombo_ConvertingValueToDisplayString);
            grid[l_CurrentRow, 1]           = new Cells.Cell(Keys.Enter);
            grid[l_CurrentRow, 1].DataModel = l_KeysCombo;

            l_CurrentRow++;

            string[] l_CmbArr = new string[] { "Value 1", "Value 2", "Value 3" };
            //ComboBox 1
            grid[l_CurrentRow, 0] = new Cells.Cell("ComboBox String", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.ComboBox(l_CmbArr[0], typeof(string), l_CmbArr, false);

            l_CurrentRow++;

            //ComboBox 2
            grid[l_CurrentRow, 0] = new Cells.Cell("ComboBox String Exclusive", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.ComboBox(l_CmbArr[0], typeof(string), l_CmbArr, true);

            l_CurrentRow++;

            //ComboBox 3
            grid[l_CurrentRow, 0] = new Cells.Cell("ComboBox String No TextBox", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.ComboBox(l_CmbArr[0], typeof(string), l_CmbArr, true);
            grid[l_CurrentRow, 1].DataModel.AllowStringConversion = false;

            l_CurrentRow++;

            //ComboBox DateTime Editable
            grid[l_CurrentRow, 0] = new Cells.Cell("ComboBox DateTime", null, l_CaptionModel);
            DateTime[] l_CmbArrDt = new DateTime[] { new DateTime(1981, 10, 6), new DateTime(1991, 10, 6), new DateTime(2001, 10, 6) };
            grid[l_CurrentRow, 1] = new Cells.ComboBox(l_CmbArrDt[0], typeof(DateTime), l_CmbArrDt, false);

            l_CurrentRow++;

            //ComboBox Custom Display (create a datamodel that has a custom display string)
            grid[l_CurrentRow, 0] = new Cells.Cell("ComboBox Custom Display", null, l_CaptionModel);
            int[] l_CmbArrInt = new int[] { 0, 1, 2, 3, 4 };
            SourceGrid2.DataModels.EditorComboBox l_ComboBoxDescription        = new SourceGrid2.DataModels.EditorComboBox(typeof(int), l_CmbArrInt, true);
            SourceLibrary.ComponentModel.Validator.ValueMapping l_ComboMapping = new SourceLibrary.ComponentModel.Validator.ValueMapping();
            l_ComboMapping.DisplayStringList = new string[] { "0 - Zero", "1 - One", "2 - Two", "3 - Three", "4- Four" };
            l_ComboMapping.ValueList         = l_CmbArrInt;
            l_ComboMapping.BindValidator(l_ComboBoxDescription);
            grid[l_CurrentRow, 1]           = new Cells.Cell(0);
            grid[l_CurrentRow, 1].DataModel = l_ComboBoxDescription;

            Cells.Cell l_CellComboRealValue = new Cells.Cell(grid[l_CurrentRow, 1].Value, null, l_CaptionModel);
            SourceGrid2.BehaviorModels.BindProperty l_ComboBindProperty = new SourceGrid2.BehaviorModels.BindProperty(typeof(Cells.Cell).GetProperty("Value"), l_CellComboRealValue);
            grid[l_CurrentRow, 1].Behaviors.Add(l_ComboBindProperty);
            grid[l_CurrentRow, 2] = l_CellComboRealValue;

            l_CurrentRow++;

            //Numeric Up Down Editor
            grid[l_CurrentRow, 0] = new Cells.Cell("NumericUpDown", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell(0);
            SourceGrid2.DataModels.EditorNumericUpDown l_NumericUpDownEditor = new SourceGrid2.DataModels.EditorNumericUpDown(typeof(int), 100, 0, 1);
            grid[l_CurrentRow, 1].DataModel = l_NumericUpDownEditor;

            l_CurrentRow++;

            //Multiline Textbox
            grid[l_CurrentRow, 0]            = new Cells.Cell("Multiline Textbox", null, l_CaptionModel);
            grid[l_CurrentRow, 0].ColumnSpan = 1;
            grid[l_CurrentRow, 0].RowSpan    = 2;

            grid[l_CurrentRow, 1] = new Cells.Cell("Hello\r\nWorld");
            SourceGrid2.DataModels.EditorTextBox l_MultilineEditor = new SourceGrid2.DataModels.EditorTextBox(typeof(string));
            l_MultilineEditor.Multiline     = true;
            grid[l_CurrentRow, 1].DataModel = l_MultilineEditor;
            grid[l_CurrentRow, 1].RowSpan   = 2;

            l_CurrentRow++;
            l_CurrentRow++;

            //Boolean (CheckBox)
            grid[l_CurrentRow, 0] = new Cells.Cell("Boolean (CheckBox)", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.CheckBox(true);

            Cells.CheckBox l_DisabledCheckBox = new Cells.CheckBox("Disabled Checkbox", true);
            l_DisabledCheckBox.EnableEdit = false;
            grid[l_CurrentRow, 2]         = l_DisabledCheckBox;

            l_CurrentRow++;

            //Cell Button
            grid[l_CurrentRow, 1] = new Cells.Button("CellButton");

            l_CurrentRow++;

            //Cell Link
            grid[l_CurrentRow, 1] = new Cells.Link("CellLink");

            l_CurrentRow++;

            #endregion

            #region Custom Formatting
            grid[l_CurrentRow, 0]            = new Cells.Cell("Custom Formatting", null, l_TitleModel);
            grid[l_CurrentRow, 0].ColumnSpan = 3;
            l_CurrentRow++;

            //Percent Editor
            grid[l_CurrentRow, 0] = new Cells.Cell("Percent Format", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell(0.5);
            SourceGrid2.DataModels.EditorTextBox l_PercentEditor = new SourceGrid2.DataModels.EditorTextBox(typeof(double));
            l_PercentEditor.TypeConverter   = new SourceLibrary.ComponentModel.Converter.PercentTypeConverter(typeof(double));
            grid[l_CurrentRow, 1].DataModel = l_PercentEditor;

            l_CurrentRow++;

            //Currency Editor
            grid[l_CurrentRow, 0] = new Cells.Cell("Currency Format", null, l_CaptionModel);

            grid[l_CurrentRow, 1] = new Cells.Cell(50.0M);
            SourceGrid2.DataModels.EditorTextBox l_CurrencyEditor = new SourceGrid2.DataModels.EditorTextBox(typeof(decimal));
            l_CurrencyEditor.TypeConverter  = new SourceLibrary.ComponentModel.Converter.CurrencyTypeConverter(typeof(decimal));
            grid[l_CurrentRow, 1].DataModel = l_CurrencyEditor;

            l_CurrentRow++;

            //Custom Format Number Editor
            grid[l_CurrentRow, 0] = new Cells.Cell("Custom Format Number", null, l_CaptionModel);

            Cells.Cell l_CellNumberEditor = new Cells.Cell(84.23);
            SourceGrid2.DataModels.EditorTextBox l_CustomFormatEditor = new SourceGrid2.DataModels.EditorTextBox(typeof(double));
            l_CustomFormatEditor.EnableEdit = false;

            SourceLibrary.ComponentModel.Converter.NumberTypeConverter l_NumberConverter = new SourceLibrary.ComponentModel.Converter.NumberTypeConverter(typeof(double));
            l_CustomFormatEditor.TypeConverter = l_NumberConverter;
            l_CellNumberEditor.DataModel       = l_CustomFormatEditor;
            l_CellNumberEditor.VisualModel     = l_CaptionModel;
            grid[l_CurrentRow, 1] = l_CellNumberEditor;

            grid[l_CurrentRow, 2] = new Cells.ComboBox(l_NumberConverter.Format, typeof(string), new string[] { "G", "C", "P", "000.00", "#.000" }, false);
            SourceGrid2.BehaviorModels.BindProperty l_BindProperty = new SourceGrid2.BehaviorModels.BindProperty(typeof(SourceLibrary.ComponentModel.Converter.NumberTypeConverter).GetProperty("Format"), l_NumberConverter);
            grid[l_CurrentRow, 2].Behaviors.Add(l_BindProperty);
            SourceGrid2.BehaviorModels.CustomEvents l_Event = new SourceGrid2.BehaviorModels.CustomEvents();
            l_Event.ValueChanged += new SourceGrid2.PositionEventHandler(CellCustomFormat_ValueChanged);
            grid[l_CurrentRow, 2].Behaviors.Add(l_Event);

            l_CurrentRow++;

            //DateTime 2 (using custom formatting)
            string l_FormatDt2 = "yyyy MM dd";
            grid[l_CurrentRow, 0] = new Cells.Cell("Date(" + l_FormatDt2 + ")", null, l_CaptionModel);

            string[] l_ParseFormat = new string[] { l_FormatDt2 };
            System.Globalization.DateTimeStyles l_dtStyles = System.Globalization.DateTimeStyles.AllowInnerWhite | System.Globalization.DateTimeStyles.AllowLeadingWhite | System.Globalization.DateTimeStyles.AllowTrailingWhite | System.Globalization.DateTimeStyles.AllowWhiteSpaces;
            TypeConverter l_dtConverter = new SourceLibrary.ComponentModel.Converter.DateTimeTypeConverter(l_FormatDt2, l_ParseFormat, l_dtStyles);
            string        tmp           = l_dtConverter.ConvertToString(DateTime.Today);
            DateTime      l_dtValue     = (DateTime)l_dtConverter.ConvertFromString(tmp);

            SourceGrid2.DataModels.EditorUITypeEditor l_editorDt2 = new SourceGrid2.DataModels.EditorUITypeEditor(typeof(DateTime));
            l_editorDt2.TypeConverter = l_dtConverter;
            grid[l_CurrentRow, 1]     = new Cells.Cell(DateTime.Today, l_editorDt2);

            l_CurrentRow++;

            #endregion

            #region Image And Text Properties
            grid[l_CurrentRow, 0]            = new Cells.Cell("Image And Text Properties", null, l_TitleModel);
            grid[l_CurrentRow, 0].ColumnSpan = 3;
            l_CurrentRow++;

            //Cell Image
            Cells.Cell l_CellImage1 = new Cells.Cell("Single Image", null, l_CaptionModel);
            grid[l_CurrentRow, 2] = l_CellImage1;
            l_CellImage1.RowSpan  = 5;
            SourceGrid2.VisualModels.Common l_ModelImage = new SourceGrid2.VisualModels.Common(false);
            l_ModelImage.Image       = SampleImages.FACE02;
            l_CellImage1.VisualModel = l_ModelImage;

            grid[l_CurrentRow, 0] = new Cells.Cell("Image Alignment", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(l_ModelImage.ImageAlignment, typeof(ContentAlignment));
            grid[l_CurrentRow, 1].Behaviors.Add(new SourceGrid2.BehaviorModels.BindProperty(typeof(SourceGrid2.VisualModels.Common).GetProperty("ImageAlignment"), l_ModelImage));

            l_CurrentRow++;

            grid[l_CurrentRow, 0] = new Cells.Cell("Stretch Image", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(l_ModelImage.ImageStretch, typeof(bool));
            grid[l_CurrentRow, 1].Behaviors.Add(new SourceGrid2.BehaviorModels.BindProperty(typeof(SourceGrid2.VisualModels.Common).GetProperty("ImageStretch"), l_ModelImage));

            l_CurrentRow++;

            grid[l_CurrentRow, 0] = new Cells.Cell("Text Alignment", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(l_ModelImage.TextAlignment, typeof(ContentAlignment));
            grid[l_CurrentRow, 1].Behaviors.Add(new SourceGrid2.BehaviorModels.BindProperty(typeof(SourceGrid2.VisualModels.Common).GetProperty("TextAlignment"), l_ModelImage));

            l_CurrentRow++;

            grid[l_CurrentRow, 0] = new Cells.Cell("AlignTextToImage", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(l_ModelImage.AlignTextToImage, typeof(bool));
            grid[l_CurrentRow, 1].Behaviors.Add(new SourceGrid2.BehaviorModels.BindProperty(typeof(SourceGrid2.VisualModels.Common).GetProperty("AlignTextToImage"), l_ModelImage));

            l_CurrentRow++;

            grid[l_CurrentRow, 0] = new Cells.Cell("StringFormat.FormatFlags", null, l_CaptionModel);
            grid[l_CurrentRow, 1] = new Cells.Cell(l_ModelImage.StringFormat.FormatFlags, typeof(StringFormatFlags));
            grid[l_CurrentRow, 1].Behaviors.Add(new SourceGrid2.BehaviorModels.BindProperty(typeof(StringFormat).GetProperty("FormatFlags"), l_ModelImage.StringFormat));

            l_CurrentRow++;

            // Cell VisualModelMultiImages
            grid[l_CurrentRow, 2]         = new Cells.Cell("Multi Images");
            grid[l_CurrentRow, 2].RowSpan = 5;
            SourceGrid2.VisualModels.MultiImages l_ModelMultiImages = new SourceGrid2.VisualModels.MultiImages(false);
            l_ModelMultiImages.SubImages.Add(new SourceGrid2.PositionedImage(SampleImages.FACE00, ContentAlignment.TopLeft));
            l_ModelMultiImages.SubImages.Add(new SourceGrid2.PositionedImage(SampleImages.FACE01, ContentAlignment.TopRight));
            l_ModelMultiImages.SubImages.Add(new SourceGrid2.PositionedImage(SampleImages.FACE02, ContentAlignment.BottomLeft));
            l_ModelMultiImages.SubImages.Add(new SourceGrid2.PositionedImage(SampleImages.FACE04, ContentAlignment.BottomRight));
            l_ModelMultiImages.StringFormat.FormatFlags = StringFormatFlags.DirectionVertical;
            grid[l_CurrentRow, 2].VisualModel           = l_ModelMultiImages;

            l_CurrentRow++;
            l_CurrentRow++;
            l_CurrentRow++;
            l_CurrentRow++;
            #endregion


            grid.AutoSizeAll();
            grid.AutoStretchColumnsToFitWidth = true;
            grid.StretchColumnsToFitWidth();
        }
コード例 #2
0
        public void Init格式()
        {
            toolStripCboElement.Items.Clear();
            if (GlobeVal.mysys.language == 0)
            {
                toolStripCboElement.Items.Add("标题栏");
                toolStripCboElement.Items.Add("固定列");
                toolStripCboElement.Items.Add("内容");
            }
            else
            {
                toolStripCboElement.Items.Add("Title bar");
                toolStripCboElement.Items.Add("Fixed column");
                toolStripCboElement.Items.Add("Content");
            }
            toolStripCboElement.SelectedIndex = 0;

            if (resulttab == 0)
            {
                grid1.RowsCount = 0;


                grid1.BorderStyle = BorderStyle.Fixed3D;
                grid1.AutoStretchRowsToFitHeight = true;
                grid1.ColumnsCount = CComLibrary.GlobeVal.filesave.mtablecol1.Count + 2;

                grid1.FixedRows    = 1;
                grid1.FixedColumns = 1;
                grid1.Rows.Insert(0);
                grid1.Rows[0].Height = 30;


                SourceGrid2.Cells.Real.ColumnHeader boldHeader = new SourceGrid2.Cells.Real.ColumnHeader();
                boldHeader.Font = new Font(CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderFont.FontFamily,
                                           CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderFont.Size);
                boldHeader.EnableSort    = false;
                boldHeader.WordWrap      = true;
                boldHeader.Value         = "";
                boldHeader.TextAlignment = CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderAlignment;
                boldHeader.BackColor     = CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderBackColor;
                boldHeader.ForeColor     = CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderForeColor;

                grid1[0, 0] = boldHeader;



                for (int i = 0; i < CComLibrary.GlobeVal.filesave.mtablecol1.Count; i++)
                {
                    boldHeader      = new SourceGrid2.Cells.Real.ColumnHeader();
                    boldHeader.Font = new Font(CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderFont.FontFamily,
                                               CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderFont.Size);
                    boldHeader.EnableSort = false;
                    boldHeader.WordWrap   = true;
                    if (CComLibrary.GlobeVal.filesave.mtablecol1[i].apply == false)
                    {
                        boldHeader.Value = CComLibrary.GlobeVal.filesave.mtablecol1[i].formulaname + "(" +
                                           CComLibrary.GlobeVal.filesave.mtablecol1[i].myitemsignal.cUnits[
                            CComLibrary.GlobeVal.filesave.mtablecol1[i].myitemsignal.cUnitsel] + ")";
                    }
                    else
                    {
                        boldHeader.Value = CComLibrary.GlobeVal.filesave.mtablecol1[i].formulaexplain + "(" +
                                           CComLibrary.GlobeVal.filesave.mtablecol1[i].myitemsignal.cUnits[
                            CComLibrary.GlobeVal.filesave.mtablecol1[i].myitemsignal.cUnitsel] + ")";
                    }
                    boldHeader.TextAlignment = CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderAlignment;
                    boldHeader.BackColor     = CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderBackColor;
                    boldHeader.ForeColor     = CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderForeColor;

                    grid1[0, 1 + i] = boldHeader;
                }

                boldHeader      = new SourceGrid2.Cells.Real.ColumnHeader();
                boldHeader.Font = new Font(CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderFont.FontFamily,
                                           CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderFont.Size);
                boldHeader.EnableSort = false;
                boldHeader.WordWrap   = true;
                boldHeader.Value      = "";
                boldHeader.BackColor  = CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderBackColor;
                boldHeader.ForeColor  = CComLibrary.GlobeVal.filesave.mtable1para.mTableHeaderPara.HeaderForeColor;


                grid1[0, CComLibrary.GlobeVal.filesave.mtablecol1.Count + 1] = boldHeader;


                int mw = grid1.Width / grid1.ColumnsCount;

                for (int i = 0; i < grid1.ColumnsCount; i++)
                {
                    grid1.Columns[i].Width = mw - 1;
                }


                grid1.Columns[grid1.ColumnsCount - 1].AutoSizeMode = SourceGrid2.AutoSizeMode.EnableStretch;

                grid1.AutoStretchColumnsToFitWidth = true;

                for (int i = 1; i <= 4; i++)
                {
                    grid1.Rows.Insert(i);


                    grid1[i, 0] = new SourceGrid2.Cells.Real.Button(
                        typeof(string));
                    (grid1[i, 0] as SourceGrid2.Cells.Real.Button).Value = i.ToString();

                    SourceGrid2.VisualModels.MultiImages view = new SourceGrid2.VisualModels.MultiImages();
                    view.BackColor = CComLibrary.GlobeVal.filesave.mtable1para.mTableColPara.ColBackColor;
                    view.ForeColor = CComLibrary.GlobeVal.filesave.mtable1para.mTableColPara.ColForeColor;

                    view.Font = new Font(CComLibrary.GlobeVal.filesave.mtable1para.mTableColPara.ColFont.FontFamily,
                                         CComLibrary.GlobeVal.filesave.mtable1para.mTableColPara.ColFont.Size);

                    if ((i == 2) || (i == 3))
                    {
                        if (CComLibrary.GlobeVal.filesave.mtable1para.showvalidspe == true)
                        {
                            view.Image = imageList1.Images[1];
                        }
                        else
                        {
                            view.Image = imageList1.Images[0];
                        }
                    }
                    else
                    {
                        view.Image = imageList1.Images[0];
                    }
                    view.TextAlignment = CComLibrary.GlobeVal.filesave.mtable1para.mTableColPara.ColAlignment;


                    grid1[i, 0].VisualModel = view;


                    for (int j = 0; j < CComLibrary.GlobeVal.filesave.mtablecol1.Count; j++)
                    {
                        float  t = 0;
                        string s = t.ToString("F" + CComLibrary.GlobeVal.filesave.mtablecol1[j].myitemsignal.precise.ToString().Trim());

                        if (CComLibrary.GlobeVal.filesave.mtablecol1[j].myitemsignal.cUnitKind == 19)
                        {
                            s = "";
                        }

                        grid1[i, 1 + j] = new SourceGrid2.Cells.Real.Cell(
                            s, typeof(string));
                        (grid1[i, 1 + j] as SourceGrid2.Cells.Real.Cell).TextAlignment = CComLibrary.GlobeVal.filesave.mtable1para.mTableGridPara.GridAlignment;
                        (grid1[i, 1 + j] as SourceGrid2.Cells.Real.Cell).BackColor     = CComLibrary.GlobeVal.filesave.mtable1para.mTableGridPara.GridBackColor;
                        (grid1[i, 1 + j] as SourceGrid2.Cells.Real.Cell).ForeColor     = CComLibrary.GlobeVal.filesave.mtable1para.mTableGridPara.GridForeColor;

                        (grid1[i, 1 + j] as SourceGrid2.Cells.Real.Cell).Font = new Font(CComLibrary.GlobeVal.filesave.mtable1para.mTableGridPara.GridFont.FontFamily,
                                                                                         CComLibrary.GlobeVal.filesave.mtable1para.mTableGridPara.GridFont.Size);
                    }

                    grid1[i, grid1.ColumnsCount - 1] = new SourceGrid2.Cells.Real.Cell(
                        "", typeof(string));
                }

                chkspe.Checked = CComLibrary.GlobeVal.filesave.mtable1para.showvalidspe;
                if (CComLibrary.GlobeVal.filesave.mtable1para.statisticssel == 0)
                {
                    this.radioButton1.Checked = true;
                    this.radioButton2.Checked = false;
                    this.radioButton3.Checked = false;
                }
                if (CComLibrary.GlobeVal.filesave.mtable1para.statisticssel == 1)
                {
                    this.radioButton1.Checked = false;
                    this.radioButton2.Checked = true;
                    this.radioButton3.Checked = false;
                }

                if (CComLibrary.GlobeVal.filesave.mtable1para.statisticssel == 2)
                {
                    this.radioButton1.Checked = false;
                    this.radioButton2.Checked = false;
                    this.radioButton3.Checked = true;
                }
            }

            if (resulttab == 1)
            {
                grid1.RowsCount = 0;


                grid1.BorderStyle = BorderStyle.Fixed3D;
                grid1.AutoStretchRowsToFitHeight = true;
                grid1.ColumnsCount = CComLibrary.GlobeVal.filesave.mtablecol2.Count + 2;

                grid1.FixedRows    = 1;
                grid1.FixedColumns = 1;

                grid1.Rows.Insert(0);
                grid1.Rows[0].Height = 30;


                SourceGrid2.Cells.Real.ColumnHeader boldHeader = new SourceGrid2.Cells.Real.ColumnHeader();
                boldHeader.Font = new Font(CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderFont.FontFamily,
                                           CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderFont.Size);
                boldHeader.EnableSort    = false;
                boldHeader.WordWrap      = true;
                boldHeader.Value         = "";
                boldHeader.TextAlignment = CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderAlignment;
                boldHeader.BackColor     = CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderBackColor;
                boldHeader.ForeColor     = CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderForeColor;

                grid1[0, 0] = boldHeader;



                for (int i = 0; i < CComLibrary.GlobeVal.filesave.mtablecol2.Count; i++)
                {
                    boldHeader      = new SourceGrid2.Cells.Real.ColumnHeader();
                    boldHeader.Font = new Font(CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderFont.FontFamily,
                                               CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderFont.Size);
                    boldHeader.EnableSort = false;
                    boldHeader.WordWrap   = true;

                    if (CComLibrary.GlobeVal.filesave.mtablecol2[i].apply == false)
                    {
                        boldHeader.Value = CComLibrary.GlobeVal.filesave.mtablecol2[i].formulaname + "(" +
                                           CComLibrary.GlobeVal.filesave.mtablecol2[i].myitemsignal.cUnits[
                            CComLibrary.GlobeVal.filesave.mtablecol2[i].myitemsignal.cUnitsel] + ")";
                    }
                    else
                    {
                        boldHeader.Value = CComLibrary.GlobeVal.filesave.mtablecol2[i].formulaexplain + "(" +
                                           CComLibrary.GlobeVal.filesave.mtablecol2[i].myitemsignal.cUnits[
                            CComLibrary.GlobeVal.filesave.mtablecol2[i].myitemsignal.cUnitsel] + ")";
                    }
                    boldHeader.TextAlignment = CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderAlignment;
                    boldHeader.BackColor     = CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderBackColor;
                    boldHeader.ForeColor     = CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderForeColor;

                    grid1[0, 1 + i] = boldHeader;
                }

                boldHeader      = new SourceGrid2.Cells.Real.ColumnHeader();
                boldHeader.Font = new Font(CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderFont.FontFamily,
                                           CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderFont.Size);
                boldHeader.EnableSort = false;
                boldHeader.WordWrap   = true;
                boldHeader.Value      = "";
                boldHeader.BackColor  = CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderBackColor;
                boldHeader.ForeColor  = CComLibrary.GlobeVal.filesave.mtable2para.mTableHeaderPara.HeaderForeColor;


                grid1[0, CComLibrary.GlobeVal.filesave.mtablecol2.Count + 1] = boldHeader;


                int mw = grid1.Width / grid1.ColumnsCount;

                for (int i = 0; i < grid1.ColumnsCount; i++)
                {
                    grid1.Columns[i].Width = mw - 1;
                }


                grid1.Columns[grid1.ColumnsCount - 1].AutoSizeMode = SourceGrid2.AutoSizeMode.EnableStretch;

                grid1.AutoStretchColumnsToFitWidth = true;

                for (int i = 1; i <= 4; i++)
                {
                    grid1.Rows.Insert(i);


                    grid1[i, 0] = new SourceGrid2.Cells.Real.Button(
                        typeof(string));
                    (grid1[i, 0] as SourceGrid2.Cells.Real.Button).Value = i.ToString();

                    SourceGrid2.VisualModels.MultiImages view = new SourceGrid2.VisualModels.MultiImages();
                    view.BackColor = CComLibrary.GlobeVal.filesave.mtable2para.mTableColPara.ColBackColor;
                    view.ForeColor = CComLibrary.GlobeVal.filesave.mtable2para.mTableColPara.ColForeColor;

                    view.Font = new Font(CComLibrary.GlobeVal.filesave.mtable2para.mTableColPara.ColFont.FontFamily,
                                         CComLibrary.GlobeVal.filesave.mtable2para.mTableColPara.ColFont.Size);

                    if ((i == 2) || (i == 3))
                    {
                        if (CComLibrary.GlobeVal.filesave.mtable1para.showvalidspe == true)
                        {
                            view.Image = imageList1.Images[1];
                        }
                        else
                        {
                            view.Image = imageList1.Images[0];
                        }
                    }
                    else
                    {
                        view.Image = imageList1.Images[0];
                    }
                    view.TextAlignment = CComLibrary.GlobeVal.filesave.mtable2para.mTableColPara.ColAlignment;


                    grid1[i, 0].VisualModel = view;


                    for (int j = 0; j < CComLibrary.GlobeVal.filesave.mtablecol2.Count; j++)
                    {
                        grid1[i, 1 + j] = new SourceGrid2.Cells.Real.Cell(
                            "0.000", typeof(string));
                        (grid1[i, 1 + j] as SourceGrid2.Cells.Real.Cell).TextAlignment = CComLibrary.GlobeVal.filesave.mtable2para.mTableGridPara.GridAlignment;
                        (grid1[i, 1 + j] as SourceGrid2.Cells.Real.Cell).BackColor     = CComLibrary.GlobeVal.filesave.mtable2para.mTableGridPara.GridBackColor;
                        (grid1[i, 1 + j] as SourceGrid2.Cells.Real.Cell).ForeColor     = CComLibrary.GlobeVal.filesave.mtable2para.mTableGridPara.GridForeColor;

                        (grid1[i, 1 + j] as SourceGrid2.Cells.Real.Cell).Font = new Font(CComLibrary.GlobeVal.filesave.mtable2para.mTableGridPara.GridFont.FontFamily,
                                                                                         CComLibrary.GlobeVal.filesave.mtable2para.mTableGridPara.GridFont.Size);
                    }

                    grid1[i, grid1.ColumnsCount - 1] = new SourceGrid2.Cells.Real.Cell(
                        "", typeof(string));
                }

                chkspe.Checked = CComLibrary.GlobeVal.filesave.mtable2para.showvalidspe;
                if (CComLibrary.GlobeVal.filesave.mtable2para.statisticssel == 0)
                {
                    this.radioButton1.Checked = true;
                    this.radioButton2.Checked = false;
                    this.radioButton3.Checked = false;
                }
                if (CComLibrary.GlobeVal.filesave.mtable2para.statisticssel == 1)
                {
                    this.radioButton1.Checked = false;
                    this.radioButton2.Checked = true;
                    this.radioButton3.Checked = false;
                }

                if (CComLibrary.GlobeVal.filesave.mtable2para.statisticssel == 2)
                {
                    this.radioButton1.Checked = false;
                    this.radioButton2.Checked = false;
                    this.radioButton3.Checked = true;
                }
            }
        }