示例#1
0
        public StackGrid(MainModel Model)
        {
            model = Model;

            //get images from the global resource.
            glassImg         = Properties.Resources.glass;
            glassDisabledImg = Properties.Resources.lupedisabled;
            behaviorEdit     = new BehaviorEdit(model);
            ColumnsCount     = 4;
            RowsCount        = 1;
            this[0, 0]       = new SourceGrid2.Cells.Real.ColumnHeader("");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 0]).EnableSort = false;
            this[0, 1] = new SourceGrid2.Cells.Real.ColumnHeader(Properties.Resources.Item);
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 1]).EnableSort = false;
            this[0, 2] = new SourceGrid2.Cells.Real.ColumnHeader(Properties.Resources.Line);
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 2]).EnableSort = false;
            this[0, 3] = new SourceGrid2.Cells.Real.ColumnHeader(Properties.Resources.Method);
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 3]).EnableSort = false;

            this.Columns[0].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[0].Width        = 20;
            this.Columns[1].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[1].Width        = 120;
            this.Columns[2].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[2].Width        = 35;
            this.Columns[3].AutoSizeMode = SourceGrid2.AutoSizeMode.EnableAutoSize | SourceGrid2.AutoSizeMode.EnableStretch;
            this.Columns[3].Width        = 50;
            this.AutoSize();
            this.AutoStretchColumnsToFitWidth = true;
            this.StretchColumnsToFitWidth();
            this.CustomSort = false;
        }
示例#2
0
        public void LoadList()
        {
            if (m_ItemType == null)
            {
                throw new ApplicationException("ItemType is null");
            }
            if (m_List == null)
            {
                m_List = new ArrayList();
            }

            if (m_Properties.Length != m_Editors.Length)
            {
                throw new ApplicationException("Properteis.Length != Editors.Length");
            }

            grid.FixedRows    = 1;
            grid.FixedColumns = 0;
            grid.Redim(m_List.Count + grid.FixedRows, m_Properties.Length + grid.FixedColumns);

            //HeaderCell
            //grid[0,0] = new Cells.Header();
            for (int i = 0; i < m_Properties.Length; i++)
            {
                Cells.ColumnHeader l_Header = new Cells.ColumnHeader(m_Properties[i].Name);

                grid[0, i + grid.FixedColumns] = l_Header;

                l_Header.EnableSort = false;
//				//If the column type support the IComparable then I can use the value to sort the column, otherwise I use the string representation for sort.
//				if (typeof(IComparable).IsAssignableFrom(m_Properties[i].PropertyType))
//					l_Header.Comparer = new SourceGrid2.ValueCellComparer();
//				else
//					l_Header.Comparer = new SourceGrid2.DisplayStringCellComparer();
            }

            for (int r = 0; r < m_List.Count; r++)
            {
                PopulateRow(r + grid.FixedRows, m_List[r]);
            }
            grid.AutoStretchRowsToFitHeight = false;

            grid.AutoStretchColumnsToFitWidth = true;


            grid.AutoSizeAll(20, 20);
        }
示例#3
0
        public ImportsGrid()
        {
            //get images from the global resource.
            glassImg       = Resources.glass;
            deleteImg      = Resources.delete;
            behaviorDelete = new BehaviorDelete();
            behaviorEdit   = new BehaviorEdit();
            ColumnsCount   = 6;
            RowsCount      = 2;
            this[0, 0]     = new SourceGrid2.Cells.Real.ColumnHeader("");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 0]).EnableSort = false;
            this[0, 1] = new SourceGrid2.Cells.Real.ColumnHeader("");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 1]).EnableSort = false;
            this[0, 2] = new SourceGrid2.Cells.Real.ColumnHeader("");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 2]).EnableSort = false;
            this[0, 3] = new SourceGrid2.Cells.Real.ColumnHeader("Dll");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 3]).EnableSort = false;
            this[0, 4] = new SourceGrid2.Cells.Real.ColumnHeader("Path");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 4]).EnableSort = false;

            this[0] = "";

            this.Columns[0].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[0].Width        = 20;
            this.Columns[1].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[1].Width        = 20;
            this.Columns[2].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[2].Width        = 20;
            this.Columns[3].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[3].Width        = 150;
            this.Columns[4].AutoSizeMode = SourceGrid2.AutoSizeMode.EnableStretch;
            this.AutoSize();
            this.AutoStretchColumnsToFitWidth = true;
            this.StretchColumnsToFitWidth();
            this.CustomSort = false;

            Reset();

            fileDialog = new OpenFileDialog();
            fileDialog.AddExtension    = true;
            fileDialog.CheckFileExists = fileDialog.CheckPathExists = false;
            fileDialog.DefaultExt      = "dll";
            fileDialog.Filter          = "dll's & exe (*.dll, *.exe)|*.dll;*.exe";
            fileDialog.Multiselect     = false;
            fileDialog.Title           = "Select dll library";
        }
示例#4
0
        public ItemsGrid()
        {
            //get images from the global resource.
            glassImg       = Resources.glass;
            deleteImg      = Resources.delete;
            parImg         = Resources.par;
            parDisabledImg = Resources.pardisabled;
            upDownImg      = Resources.updown;
            behaviorDelete = new BehaviorDelete();
            behaviorEdit   = new BehaviorEdit();
            ColumnsCount   = 7;
            RowsCount      = 1;
            this[0, 0]     = new SourceGrid2.Cells.Real.ColumnHeader("");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 0]).EnableSort = false;
            this[0, 1] = new SourceGrid2.Cells.Real.ColumnHeader("");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 1]).EnableSort = false;
            this[0, 2] = new SourceGrid2.Cells.Real.ColumnHeader("");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 2]).EnableSort = false;
            this[0, 3] = new SourceGrid2.Cells.Real.ColumnHeader("");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 3]).EnableSort = false;
            this[0, 4] = new SourceGrid2.Cells.Real.ColumnHeader("");
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 4]).EnableSort = false;
            this[0, 5] = new SourceGrid2.Cells.Real.ColumnHeader(Resources.Name);
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 5]).EnableSort = false;
            this[0, 6] = new SourceGrid2.Cells.Real.ColumnHeader(Resources.Type);
            ((SourceGrid2.Cells.Real.ColumnHeader) this[0, 6]).EnableSort = false;

            this.Columns[0].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[0].Width        = 20;
            this.Columns[1].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[1].Width        = 20;
            this.Columns[2].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[2].Width        = 20;
            this.Columns[3].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[3].Width        = 20;
            this.Columns[4].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
            this.Columns[4].Width        = 20;
            this.Columns[5].AutoSizeMode = SourceGrid2.AutoSizeMode.EnableAutoSize | SourceGrid2.AutoSizeMode.EnableStretch;
            this.Columns[6].AutoSizeMode = SourceGrid2.AutoSizeMode.None;
            this.Columns[6].Width        = 80;
            this.AutoSize();
            this.AutoStretchColumnsToFitWidth = true;
            this.StretchColumnsToFitWidth();
            this.CustomSort = false;
        }
示例#5
0
        private void InitRecipientsGrid()
        {
            if (gridRecipients != null)
            {
                gridRecipients.AutoStretchColumnsToFitWidth = true;

                SourceGrid2.VisualModels.Common vmHeader =
                    new SourceGrid2.VisualModels.FlatHeader();
                vmHeader.BackColor = Color.FromArgb(228, 229, 237);
                SourceGrid2.BehaviorModels.Header bmHeader = new SourceGrid2.BehaviorModels.Header();

                // set up the header row
                gridRecipients.Rows.Insert(0);

                gridRecipients.Columns.Insert(0);
                gridRecipients[0, COL_EMAILADDRESS] = new SourceGrid2.Cells.Real.ColumnHeader("Email", vmHeader, bmHeader);

                gridRecipients.Columns.Insert(1);
                gridRecipients[0, COL_NAME] = new SourceGrid2.Cells.Real.ColumnHeader("Name", vmHeader, bmHeader);

                gridRecipients.Columns.Insert(2);
                gridRecipients[0, COL_COMPANY] = new SourceGrid2.Cells.Real.ColumnHeader("Company", vmHeader, bmHeader);

                gridRecipients.Columns.Insert(3);
                gridRecipients[0, COL_INTRO] = new SourceGrid2.Cells.Real.ColumnHeader("Intro", vmHeader, bmHeader);

                gridRecipients.Columns.Insert(4);
                gridRecipients[0, COL_CONTACT] = new SourceGrid2.Cells.Real.ColumnHeader("Contact", vmHeader, bmHeader);

                // Size Column Widths
                int columnWidth = gridRecipients.Width / gridRecipients.ColumnsCount;
                for (int i = 0; i < gridRecipients.ColumnsCount; i++)
                {
                    gridRecipients.Columns[i].Width = columnWidth;
                }

                //AddRow(); // first row
            }
        }
示例#6
0
        private void frmSampleGrid1_Load(object sender, System.EventArgs e)
        {
            string[] l_CountryList = new string[] { "Italy", "France", "Spain", "UK", "Argentina", "Mexico", "Switzerland", "Brazil", "Germany", "Portugal", "Sweden", "Austria" };

            grid1.RowsCount                    = 1;
            grid1.ColumnsCount                 = 10;
            grid1.FixedRows                    = 1;
            grid1.FixedColumns                 = 1;
            grid1.Selection.SelectionMode      = SourceGrid2.GridSelectionMode.Row;
            grid1.AutoStretchColumnsToFitWidth = true;
            grid1.Columns[0].AutoSizeMode      = SourceGrid2.AutoSizeMode.None;
            grid1.Columns[0].Width             = 30;

            #region Create Header Row and Editor
            Cells.Header l_00Header = new Cells.Header();
            grid1[0, 0] = l_00Header;

            m_CellEditor_Id = SourceGrid2.Utility.CreateDataModel(typeof(int));
            m_CellEditor_Id.EditableMode = SourceGrid2.EditableMode.Focus | SourceGrid2.EditableMode.AnyKey | SourceGrid2.EditableMode.SingleClick;
            grid1[0, 1] = new Cells.ColumnHeader("ID (int)");

            m_CellEditor_Name = SourceGrid2.Utility.CreateDataModel(typeof(string));
            m_CellEditor_Name.EditableMode = SourceGrid2.EditableMode.Focus | SourceGrid2.EditableMode.AnyKey | SourceGrid2.EditableMode.SingleClick;
            grid1[0, 2] = new Cells.ColumnHeader("NAME (string)");

            m_CellEditor_Address = SourceGrid2.Utility.CreateDataModel(typeof(string));
            m_CellEditor_Address.EditableMode = SourceGrid2.EditableMode.Focus | SourceGrid2.EditableMode.AnyKey | SourceGrid2.EditableMode.SingleClick;
            grid1[0, 3] = new Cells.ColumnHeader("ADDRESS (string)");

            m_CellEditor_City = SourceGrid2.Utility.CreateDataModel(typeof(string));
            m_CellEditor_City.EditableMode = SourceGrid2.EditableMode.Focus | SourceGrid2.EditableMode.AnyKey | SourceGrid2.EditableMode.SingleClick;
            grid1[0, 4] = new Cells.ColumnHeader("CITY (string)");

            m_CellEditor_BirthDay = SourceGrid2.Utility.CreateDataModel(typeof(DateTime));
            m_CellEditor_BirthDay.EditableMode = SourceGrid2.EditableMode.Focus | SourceGrid2.EditableMode.AnyKey | SourceGrid2.EditableMode.SingleClick;
            grid1[0, 5] = new Cells.ColumnHeader("BIRTHDATE (DateTime)");

            m_CellEditor_Country = new SourceGrid2.DataModels.EditorComboBox(typeof(string), l_CountryList, false);
            m_CellEditor_Country.EditableMode = SourceGrid2.EditableMode.Focus | SourceGrid2.EditableMode.AnyKey | SourceGrid2.EditableMode.SingleClick;
            grid1[0, 6] = new Cells.ColumnHeader("COUNTRY (string + combobox)");

            m_CellEditor_Price = new SourceGrid2.DataModels.EditorTextBox(typeof(double));
            m_CellEditor_Price.TypeConverter = new SourceLibrary.ComponentModel.Converter.CurrencyTypeConverter(typeof(double));
            m_CellEditor_Price.EditableMode  = SourceGrid2.EditableMode.Focus | SourceGrid2.EditableMode.AnyKey | SourceGrid2.EditableMode.SingleClick;
            grid1[0, 7] = new Cells.ColumnHeader("$ PRICE (double)");

            grid1[0, 8] = new Cells.ColumnHeader("Selected");

            grid1[0, 9] = new Cells.ColumnHeader("WebSite");
            #endregion


            #region Visual Properties
            //set Cells style
            m_VisualProperties = new SourceGrid2.VisualModels.Common(false);

            m_VisualPropertiesPrice = (SourceGrid2.VisualModels.Common)m_VisualProperties.Clone(false);
            m_VisualPropertiesPrice.TextAlignment = ContentAlignment.MiddleRight;

            m_VisualPropertiesCheckBox = (SourceGrid2.VisualModels.CheckBox)SourceGrid2.VisualModels.CheckBox.Default.Clone(false);

            m_VisualPropertiesLink = (SourceGrid2.VisualModels.Common)SourceGrid2.VisualModels.Common.LinkStyle.Clone(false);
            #endregion

            //read xml
            System.IO.StreamReader l_Reader = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("SampleProject.Samples.SampleData.xml"));
            System.Xml.XmlDocument l_XmlDoc = new System.Xml.XmlDocument();
            l_XmlDoc.LoadXml(l_Reader.ReadToEnd());
            l_Reader.Close();
            System.Xml.XmlNodeList l_Rows = l_XmlDoc.SelectNodes("//row");
            grid1.RowsCount = l_Rows.Count + 1;
            int l_RowsCount = 1;
            foreach (System.Xml.XmlNode l_Node in l_Rows)
            {
                #region Pupulate RowsCount
                grid1[l_RowsCount, 0] = new Cells.RowHeader();

                grid1[l_RowsCount, 1]             = new Cells.Cell(l_RowsCount);
                grid1[l_RowsCount, 1].DataModel   = m_CellEditor_Id;
                grid1[l_RowsCount, 1].VisualModel = m_VisualProperties;

                grid1[l_RowsCount, 2]             = new Cells.Cell(l_Node.Attributes["ContactName"].InnerText);
                grid1[l_RowsCount, 2].DataModel   = m_CellEditor_Name;
                grid1[l_RowsCount, 2].VisualModel = m_VisualProperties;

                grid1[l_RowsCount, 3]             = new Cells.Cell(l_Node.Attributes["Address"].InnerText);
                grid1[l_RowsCount, 3].DataModel   = m_CellEditor_Address;
                grid1[l_RowsCount, 3].VisualModel = m_VisualProperties;

                grid1[l_RowsCount, 4]             = new Cells.Cell(l_Node.Attributes["City"].InnerText);
                grid1[l_RowsCount, 4].DataModel   = m_CellEditor_City;
                grid1[l_RowsCount, 4].VisualModel = m_VisualProperties;

                grid1[l_RowsCount, 5]             = new Cells.Cell(DateTime.Today);
                grid1[l_RowsCount, 5].DataModel   = m_CellEditor_BirthDay;
                grid1[l_RowsCount, 5].VisualModel = m_VisualProperties;

                grid1[l_RowsCount, 6]             = new Cells.Cell(l_Node.Attributes["Country"].InnerText);
                grid1[l_RowsCount, 6].DataModel   = m_CellEditor_Country;
                grid1[l_RowsCount, 6].VisualModel = m_VisualProperties;

                grid1[l_RowsCount, 7]             = new Cells.Cell(25.0);
                grid1[l_RowsCount, 7].DataModel   = m_CellEditor_Price;
                grid1[l_RowsCount, 7].VisualModel = m_VisualPropertiesPrice;

                grid1[l_RowsCount, 8]             = new Cells.CheckBox(false);
                grid1[l_RowsCount, 8].VisualModel = m_VisualPropertiesCheckBox;

                grid1[l_RowsCount, 9]                      = new Cells.Link(l_Node.Attributes["website"].InnerText);
                grid1[l_RowsCount, 9].VisualModel          = m_VisualPropertiesLink;
                ((Cells.Link)grid1[l_RowsCount, 9]).Click += new SourceGrid2.PositionEventHandler(CellLink_Click);
                #endregion

                l_RowsCount++;
            }

            grid1.AutoSizeAll();
        }
示例#7
0
        private void SetupGrid()
        {
            gridLog.Selection.SelectionMode = SourceGrid2.GridSelectionMode.Row;
            gridLog.BorderStyle = BorderStyle.FixedSingle;
            gridLog.ColumnsCount = 8;
            gridLog.FixedRows = 1;

            //
            // Create column headers
            //
            SourceGrid2.Cells.Real.ColumnHeader header;

            gridLog.Rows.Insert(0);
            gridLog[0,0] = new SourceGrid2.Cells.Real.ColumnHeader("Level");
            gridLog[0,1] = new SourceGrid2.Cells.Real.ColumnHeader("Namespace");
            gridLog[0,2] = new SourceGrid2.Cells.Real.ColumnHeader("Class");
            gridLog[0,3] = new SourceGrid2.Cells.Real.ColumnHeader("Method");
            gridLog[0,4] = new SourceGrid2.Cells.Real.ColumnHeader("Line");
            gridLog[0,5] = new SourceGrid2.Cells.Real.ColumnHeader("Message");
            gridLog[0,6] = new SourceGrid2.Cells.Real.ColumnHeader("File");

            header = new SourceGrid2.Cells.Real.ColumnHeader("Date");
            gridLog[0,7] = header;

            gridLog.Columns[0].Width = 60;
            gridLog.Columns[1].Width = 120;
            gridLog.Columns[2].Width = 120;
            gridLog.Columns[3].Width = 120;
            gridLog.Columns[5].Width = 200;
            gridLog.Columns[6].Width = 150;
            gridLog.Columns[7].Width = 150;
        }
        public void LoadList()
        {
            if (m_ItemType == null)
            {
                throw new ApplicationException("ItemType is null");
            }
            if (m_List == null)
            {
                m_List = new ArrayList();
            }

            if (m_Properties.Length != m_Editors.Length)
            {
                throw new ApplicationException("Properteis.Length != Editors.Length");
            }

            grid.FixedRows    = 1;
            grid.FixedColumns = 0;
            grid.Redim(m_List.Count + grid.FixedRows, m_Properties.Length + grid.FixedColumns);

            //HeaderCell
            //grid[0,0] = new Cells.Header();
            for (int i = 0; i < m_Properties.Length; i++)
            {
                Cells.ColumnHeader l_Header;
                if (ItemType.Name == "ChartBarTextDefine")
                {
                    if (CComLibrary.GlobeVal.languageselect == 0)
                    {
                        string[] na = { "文档名称", "文档内容", "内部名称" };
                        l_Header = new Cells.ColumnHeader(na[i]);
                    }
                    else
                    {
                        string[] na = { "Document name", "Document Value", "Internal name" };
                        l_Header = new Cells.ColumnHeader(na[i]);
                    }
                }
                else if (ItemType.Name == "ChartBarComboDefine")
                {
                    if (CComLibrary.GlobeVal.languageselect == 0)
                    {
                        string[] na = { "组合框名称", "组合框内容", "选择" };
                        l_Header = new Cells.ColumnHeader(na[i]);
                    }
                    else
                    {
                        string[] na = { "Combo name", "Combo value", "Selection" };
                        l_Header = new Cells.ColumnHeader(na[i]);
                    }
                }
                else
                {
                    l_Header = new Cells.ColumnHeader(m_Properties[i].Name);
                }
                grid[0, i + grid.FixedColumns] = l_Header;

                l_Header.EnableSort = false;
//				//If the column type support the IComparable then I can use the value to sort the column, otherwise I use the string representation for sort.
//				if (typeof(IComparable).IsAssignableFrom(m_Properties[i].PropertyType))
//					l_Header.Comparer = new SourceGrid2.ValueCellComparer();
//				else
//					l_Header.Comparer = new SourceGrid2.DisplayStringCellComparer();
            }

            for (int r = 0; r < m_List.Count; r++)
            {
                PopulateRow(r + grid.FixedRows, m_List[r]);
            }
            grid.AutoStretchRowsToFitHeight = false;

            grid.AutoStretchColumnsToFitWidth = true;


            grid.AutoSizeAll(20, 20);
        }
示例#9
0
        /// <summary>
        /// Sets up the grid column headers.
        /// </summary>
        private void SetupGrid()
        {
            SourceGrid2.Grid g = gridProperties;
            g.ColumnsCount = 3;
            g.Selection.SelectionMode = SourceGrid2.GridSelectionMode.Row;
            g.Rows.Insert(0);

            //
            // Create column headers
            //
            SourceGrid2.Cells.Real.ColumnHeader h;

            h = new SourceGrid2.Cells.Real.ColumnHeader("Name");
            g[0, 0] = h;

            h = new SourceGrid2.Cells.Real.ColumnHeader("Type");
            g[0, 1] = h;

            h = new SourceGrid2.Cells.Real.ColumnHeader("Value");
            g[0, 2] = h;
        }
示例#10
0
        public void LoadList()
        {
            if (m_ItemType == null)
            {
                throw new ApplicationException("ItemType is null");
            }
            if (m_List == null)
            {
                m_List = new ArrayList();
            }

            if (m_Properties.Length != m_Editors.Length)
            {
                throw new ApplicationException("Properteis.Length != Editors.Length");
            }

            grid.FixedRows    = 1;
            grid.FixedColumns = 0;
            grid.Redim(m_List.Count + grid.FixedRows, m_Properties.Length + grid.FixedColumns);

            //HeaderCell
            //grid[0,0] = new Cells.Header();
            for (int i = 0; i < m_Properties.Length; i++)
            {
                Cells.ColumnHeader l_Header;

                if (ItemType.Name == "ChartBar")
                {
                    if (CComLibrary.GlobeVal.languageselect == 0)
                    {
                        string[] na = { "名称", "值", "单位", "量纲" };
                        l_Header = new Cells.ColumnHeader(na[i]);
                    }
                    else
                    {
                        string[] na = { "Name", "Value", "Unit", "Dimension" };
                        l_Header = new Cells.ColumnHeader(na[i]);
                    }
                }
                else if (ItemType.Name == "ChartBarDefine")
                {
                    if (CComLibrary.GlobeVal.languageselect == 0)
                    {
                        string[] na = { "公式名称", "公式内容", "公式单位", "是否计算", "公式说明", "曲线显示", "量纲" };
                        l_Header = new Cells.ColumnHeader(na[i]);
                    }
                    else
                    {
                        string[] na = { "Formula name", "Formula content", "Formula unit", "Calculation", "Formula description", "Display on curves", "Dimension" };
                        l_Header = new Cells.ColumnHeader(na[i]);
                    }
                }
                else
                {
                    l_Header = new Cells.ColumnHeader(m_Properties[i].Name);
                }
                grid[0, i + grid.FixedColumns] = l_Header;

                l_Header.EnableSort = false;
//				//If the column type support the IComparable then I can use the value to sort the column, otherwise I use the string representation for sort.
//				if (typeof(IComparable).IsAssignableFrom(m_Properties[i].PropertyType))
//					l_Header.Comparer = new SourceGrid2.ValueCellComparer();
//				else
//					l_Header.Comparer = new SourceGrid2.DisplayStringCellComparer();
            }

            for (int r = 0; r < m_List.Count; r++)
            {
                PopulateRow(r + grid.FixedRows, m_List[r]);
            }
            grid.AutoStretchRowsToFitHeight = false;

            grid.AutoStretchColumnsToFitWidth = true;


            grid.AutoSizeAll(20, 20);
        }
示例#11
0
        private void frmSample2_Load(object sender, System.EventArgs e)
        {
            string[] l_Teams = new string[] { "Milan",
                                              "Roma",
                                              "Juventus",
                                              "Inter",
                                              "Parma",
                                              "Lazio",
                                              "Udinese",
                                              "Sampdoria",
                                              "Chievo",
                                              "Brescia",
                                              "Siena",
                                              "Bologna",
                                              "Reggina",
                                              "Modena",
                                              "Lecce",
                                              "Empoli",
                                              "Perugia",
                                              "Ancona" };

            int[] l_Points = new int[] { 48,
                                         43,
                                         43,
                                         35,
                                         33,
                                         33,
                                         30,
                                         28,
                                         25,
                                         22,
                                         21,
                                         21,
                                         20,
                                         18,
                                         15,
                                         13,
                                         11,
                                         5 };

            grid.Redim(l_Teams.Length + 1, 3);
            grid.BackColor = Color.White;

            SourceGrid2.VisualModels.Common l_NoBorder = new SourceGrid2.VisualModels.Common();
            l_NoBorder.Border = SourceGrid2.RectangleBorder.NoBorder;

            grid.FixedRows = 1;
            grid[0, 0]     = new Cells.ColumnHeader("Teams");
            grid[0, 1]     = new Cells.ColumnHeader("Points");
            grid[0, 2]     = new Cells.ColumnHeader();

            for (int r = 0; r < l_Teams.Length; r++)
            {
                grid[r + 1, 0] = new Cells.Cell(l_Teams[r], null, l_NoBorder);
                grid[r + 1, 1] = new CellPoints(l_Points[r]);
                ((CellPoints)grid[r + 1, 1]).RefreshBalls();
            }

            ((SourceGrid2.Cells.Real.Cell)grid[0, 2]).ColumnSpan = grid.ColumnsCount - 2;

            grid.AutoSizeAll();
        }