Beispiel #1
1
        private void Form1_Load(object sender, System.EventArgs e)
        {
            grid1.Redim(10, 5);
            grid1.SelectionMode = SourceGrid.GridSelectionMode.Row;

            //Setup the controllers
            CellClickEvent clickController  = new CellClickEvent();
            PopupMenu      menuController   = new PopupMenu();
            CellCursor     cursorController = new CellCursor();

            SourceGrid.Cells.Controllers.ToolTipText toolTipController = new SourceGrid.Cells.Controllers.ToolTipText();
            toolTipController.ToolTipTitle = "ToolTip example";
            toolTipController.ToolTipIcon  = ToolTipIcon.Info;
            toolTipController.IsBalloon    = true;
            ValueChangedEvent valueChangedController = new ValueChangedEvent();

            for (int r = 0; r < grid1.Rows.Count; r++)
            {
                if (r == 0)
                {
                    grid1[r, 0] = new SourceGrid.Cells.ColumnHeader("Click event");
                    grid1[r, 1] = new SourceGrid.Cells.ColumnHeader("Custom Cursor");
                    grid1[r, 2] = new SourceGrid.Cells.ColumnHeader("ContextMenu");
                    grid1[r, 3] = new SourceGrid.Cells.ColumnHeader("ToolTip");
                    grid1[r, 4] = new SourceGrid.Cells.ColumnHeader("ValueChanged");
                }
                else
                {
                    grid1[r, 0]             = new SourceGrid.Cells.Cell("Value " + r.ToString(), typeof(string));
                    grid1[r, 1]             = new SourceGrid.Cells.Cell(DateTime.Now, typeof(DateTime));
                    grid1[r, 2]             = new SourceGrid.Cells.Cell("Right click");
                    grid1[r, 3]             = new SourceGrid.Cells.Cell("Value " + r.ToString());
                    grid1[r, 3].ToolTipText = "Example of tooltip, bla bla bla ....\n Row: " + r.ToString();
                    grid1[r, 4]             = new SourceGrid.Cells.Cell("Value " + r.ToString(), typeof(string));
                }

                grid1[r, 0].AddController(clickController);
                grid1[r, 1].AddController(cursorController);
                grid1[r, 2].AddController(menuController);
                grid1[r, 3].AddController(toolTipController);
                grid1[r, 4].AddController(valueChangedController);
            }

            grid1.AutoSizeCells();

            //Add the key controller to all the cells
            grid1.Controller.AddController(new KeyEvent(this));
        }
Beispiel #2
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            grid1.Redim(10, 3);

            CellClickEvent clickController  = new CellClickEvent();
            PopupMenu      menuController   = new PopupMenu();
            CellCursor     cursorController = new CellCursor();

            for (int r = 0; r < grid1.Rows.Count; r++)
            {
                if (r == 0)
                {
                    grid1[r, 0] = new SourceGrid.Cells.ColumnHeader("Click event");
                    grid1[r, 1] = new SourceGrid.Cells.ColumnHeader("Custom Cursor");
                    grid1[r, 2] = new SourceGrid.Cells.ColumnHeader("ContextMenu");
                }
                else
                {
                    grid1[r, 0] = new SourceGrid.Cells.Cell("Value " + r.ToString(), typeof(string));
                    grid1[r, 1] = new SourceGrid.Cells.Cell(DateTime.Now, typeof(DateTime));
                    grid1[r, 2] = new SourceGrid.Cells.Cell("Right click");
                }

                grid1[r, 0].AddController(clickController);
                grid1[r, 1].AddController(cursorController);
                grid1[r, 2].AddController(menuController);
            }

            grid1.AutoSizeCells();
        }
		private void Form1_Load(object sender, System.EventArgs e)
		{
			grid1.Redim(10, 5);

            //Setup the controllers
			CellClickEvent clickController = new CellClickEvent();
			PopupMenu menuController = new PopupMenu();
			CellCursor cursorController = new CellCursor();
            SourceGrid.Cells.Controllers.ToolTipText toolTipController = new SourceGrid.Cells.Controllers.ToolTipText();
            toolTipController.ToolTipTitle = "ToolTip example";
            toolTipController.ToolTipIcon = ToolTipIcon.Info;
            toolTipController.IsBalloon = true;
            ValueChangedEvent valueChangedController = new ValueChangedEvent();
            
			for (int r = 0; r < grid1.Rows.Count; r++)
			{
				if (r == 0)
				{
					grid1[r, 0] = new SourceGrid.Cells.ColumnHeader("Click event");
					grid1[r, 1] = new SourceGrid.Cells.ColumnHeader("Custom Cursor");
					grid1[r, 2] = new SourceGrid.Cells.ColumnHeader("ContextMenu");
                    grid1[r, 3] = new SourceGrid.Cells.ColumnHeader("ToolTip");
                    grid1[r, 4] = new SourceGrid.Cells.ColumnHeader("ValueChanged");
                }
				else
				{
					grid1[r, 0] = new SourceGrid.Cells.Cell("Value " + r.ToString(), typeof(string));
					grid1[r, 1] = new SourceGrid.Cells.Cell(DateTime.Now, typeof(DateTime));
					grid1[r, 2] = new SourceGrid.Cells.Cell("Right click");
                    grid1[r, 3] = new SourceGrid.Cells.Cell("Value " + r.ToString());
                    grid1[r, 3].ToolTipText = "Example of tooltip, bla bla bla ....\n Row: " + r.ToString();
                    grid1[r, 4] = new SourceGrid.Cells.Cell("Value " + r.ToString(), typeof(string));
                }

				grid1[r, 0].AddController(clickController);
				grid1[r, 1].AddController(cursorController);
				grid1[r, 2].AddController(menuController);
                grid1[r, 3].AddController(toolTipController);
                grid1[r, 4].AddController(valueChangedController);
			}

            grid1.AutoSizeCells();

            //Add the key controller to all the cells
            grid1.Controller.AddController(new KeyEvent(this));
		}