Inheritance: GridVirtual
		public void SelectRow_ShouldMaintain_ActivePosition()
		{
			// set up special conditions
			var grid = new Grid();
			grid.Redim(1, 1);
			grid[0, 0] = new Cell();
			
			var form = new Form();
			form.Controls.Add(grid);
			form.Show();

			grid.SelectionMode = GridSelectionMode.Row;
			grid.Selection.EnableMultiSelection = false;
			
			
			// just assert that we have correct conditions for test, 
			// active position should not be empty
			grid.Selection.Focus(new Position(0, 0), true);
			Assert.AreEqual(new Position(0, 0), grid.Selection.ActivePosition);
			
			// this method causes first row to be selected. Should not fail 
			// it failed once in RowSelection.SelectRow method
			// As call to ResetSelection asked to maintain focus, a stack overflow was raised
			grid.Selection.SelectRow(0, true);
			Assert.AreEqual(new Position(0, 0), grid.Selection.ActivePosition);
			
			// destroy
			form.Close();
			form.Dispose();
		}
		public void GetCell_NonExistent()
		{
			SourceGrid.Grid grid1 = new Grid();
			grid1.Redim(2, 2);
			
			Assert.AreEqual(null, grid1.GetCell(0, 0));
		}
		public void GetCell_OutOfBounds()
		{
			Grid grid = new Grid();
			grid.Redim(5, 5);
			
			Assert.AreEqual(null, grid.GetCell(new Position(10, 10)));
		}
Beispiel #4
0
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.grid = new SourceGrid.Grid();
			this.SuspendLayout();
			// 
			// grid
			// 
			this.grid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
			                                                          | System.Windows.Forms.AnchorStyles.Left)
			                                                         | System.Windows.Forms.AnchorStyles.Right)));
			this.grid.AutoStretchColumnsToFitWidth = false;
			this.grid.AutoStretchRowsToFitHeight = false;
			this.grid.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.grid.CustomSort = false;
			this.grid.Location = new System.Drawing.Point(12, 12);
			this.grid.Name = "grid";
			this.grid.Size = new System.Drawing.Size(516, 368);
			this.grid.SpecialKeys = SourceGrid.GridSpecialKeys.Default;
			this.grid.TabIndex = 0;
			// 
			// frmSample3
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(540, 391);
			this.Controls.Add(this.grid);
			this.Name = "frmSample3";
			this.Text = "Cell Editors, Specials Cells, Formatting and Image";
			this.ResumeLayout(false);

		}
Beispiel #5
0
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.grid1 = new SourceGrid.Grid();
			this.SuspendLayout();
			// 
			// grid1
			// 
			this.grid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
			                                                           | System.Windows.Forms.AnchorStyles.Left)
			                                                          | System.Windows.Forms.AnchorStyles.Right)));
			this.grid1.Location = new System.Drawing.Point(8, 8);
			this.grid1.Name = "grid1";
			this.grid1.Size = new System.Drawing.Size(612, 423);
			this.grid1.SpecialKeys = SourceGrid.GridSpecialKeys.Default;
			this.grid1.TabIndex = 0;
			// 
			// frmSample21
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(628, 438);
			this.Controls.Add(this.grid1);
			this.Name = "frmSample21";
			this.Text = "ColumnSpan and RowSpan";
			this.Load += new System.EventHandler(this.frmSample14_Load);
			this.ResumeLayout(false);
	
		}
		public void TestTabMovement_DoesLoopCorrectly_ThroughSpannedRowCells()
		{
			using (var form = new Form())
			{
				
				Grid grid1 = new Grid();
				grid1.Redim(40,3);
				grid1.FixedColumns = 1;
				grid1.FixedRows = 1;

				Random rnd = new Random();
				for (int r = 0; r < grid1.RowsCount/2; r++)
				{
					for (int c = 0; c < grid1.ColumnsCount; c++)
					{
						grid1[r * 2, c] = new SourceGrid.Cells.Cell(r*c);
						grid1[r * 2, c].RowSpan = 2;
					}
				}
				
				form.Controls.Add(grid1);
				form.Show();
				
				Assert.AreEqual(true, grid1.Selection.Focus(new Position(0, 0), true));
				Assert.AreEqual(new Position(0, 0), grid1.Selection.ActivePosition);
				
				Assert.AreEqual(true, grid1.Selection.Focus(new Position(1, 0), true));
				Assert.AreEqual(new Position(1, 0), grid1.Selection.ActivePosition);
				
				form.Close();
			}
		}
		public void InsertOverlappingCell()
		{
			SourceGrid.Grid grid1 = new Grid();
			grid1.Redim(2, 2);
			
			// this cell should span both to the right, and to the left
			grid1[0, 0] = new SourceGrid.Cells.Cell("Text Span", typeof(string));;
			grid1[0, 0].ColumnSpan = 2;
			
			grid1[0, 1] = new SourceGrid.Cells.Cell("This should throw OverlappingCellException");
		}
		public void ModifyRowSpan_ToCauseOverlapping()
		{
			SourceGrid.Grid grid1 = new Grid();
			grid1.Redim(6, 2);
			
			// this cell should span both to the right, and to the left
			grid1[4, 0] = new SourceGrid.Cells.Cell("cell to span", typeof(string));
			grid1[5, 0] = new SourceGrid.Cells.Cell("cell to overlap", typeof(string));
			
			// this should throw exception
			grid1[4, 0].RowSpan = 2;
		}
		public void ModifyColumnSpan_ToCauseOverlapping()
		{
			SourceGrid.Grid grid1 = new Grid();
			grid1.Redim(2, 6);
			
			// this cell should span both to the right, and to the left
			grid1[0, 4] = new SourceGrid.Cells.Cell("cell to span", typeof(string));
			grid1[0, 5] = new SourceGrid.Cells.Cell("cell to overlap", typeof(string));
			
			// this should throw exception
			grid1[0, 4].ColumnSpan = 2;
		}
		public void SubscriptionToEventsAreNotChanged_After_SelectionIsChanged()
		{
			int selectionChangedCount = 0;
			Grid grid = new Grid();
			grid.Redim(5, 5);
			grid[1, 1] = new SourceGrid.Cells.Cell("b");
			
			grid.Selection.SelectionChanged += delegate { selectionChangedCount++; };
			grid.SelectionMode = GridSelectionMode.Row;
			grid.Selection.SelectCell(new Position(1, 1), true);
			Assert.AreEqual(1, selectionChangedCount);
			
		}
		public Grid CreateGridWithRows(int rowCount)
		{
			Grid grid1 = new Grid();
			grid1.ColumnsCount = 1;
			grid1.SelectionMode = GridSelectionMode.Row;
	
			for (int r = 0; r < rowCount; r++)
			{
				grid1.Rows.Insert(r);
				grid1[r, 0] = new SourceGrid.Cells.Cell("Hello " + r.ToString(), typeof(string));
			}
			
			grid1.AutoSizeCells();
			grid1.SelectionMode = GridSelectionMode.Row;
			return grid1;
		}
		public void GetCell()
		{
			SourceGrid.Grid grid1 = new Grid();
			grid1.Redim(2, 2);
			
			Cell visibleCell = new SourceGrid.Cells.Cell("Text Span", typeof(string));
			
			// this cell should span both to the right, and to the left
			grid1[0, 0] = visibleCell;
			grid1[0, 0].RowSpan = 2;
			grid1[0, 0].ColumnSpan = 2;
			
			
			Assert.AreEqual(visibleCell, grid1.GetCell(0, 0));
			Assert.AreEqual(visibleCell, grid1.GetCell(0, 1));
			Assert.AreEqual(visibleCell, grid1.GetCell(1, 0));
			Assert.AreEqual(visibleCell, grid1.GetCell(1, 1));
		}
		public void SelectSpannedCells_SingleCell()
		{
			// just select a single cell. Should select whole spanned cell
			Grid grid1 = new Grid();
			grid1.Redim(6, 6);

			grid1[0, 0] = new SourceGrid.Cells.Cell();
			grid1[0, 0].ColumnSpan = 3;
			grid1[0, 0].RowSpan = 3;

			grid1[0, 3] = new SourceGrid.Cells.Cell();
			grid1[0, 3].ColumnSpan = 3;
			grid1[0, 3].RowSpan = 3;
			
			grid1.Selection.SelectCell(new Position(0, 0), true);
			RangeRegion region = grid1.Selection.GetSelectionRegion();
			Assert.AreEqual(1, region.Count);
			Assert.AreEqual(new Range(0, 0, 2, 2), region[0]);
		}
		public void SelectSpannedCells_SingleCell_DoubleSelection()
		{
			// select at two positions the same cell
			Grid grid1 = new Grid();
			grid1.Redim(6, 6);

			grid1[0, 0] = new SourceGrid.Cells.Cell();
			grid1[0, 0].ColumnSpan = 3;
			grid1[0, 0].RowSpan = 3;

			grid1[0, 3] = new SourceGrid.Cells.Cell();
			grid1[0, 3].ColumnSpan = 3;
			grid1[0, 3].RowSpan = 3;
			
			grid1.Selection.SelectRange(new Range(0, 0, 0, 1), true);
			
			RangeRegion region = grid1.Selection.GetSelectionRegion();
			Assert.AreEqual(1, region.Count);
			Assert.AreEqual(new Range(0, 0, 2, 2), region[0]);
		}
		public void ResetSelection_DoesNotInfiniteLoop()
		{
			// set up special conditions
			var grid = new Grid();
			grid.Redim(1, 1);
			grid[0, 0] = new Cell();
			
			var form = new Form();
			form.Controls.Add(grid);
			form.Show();

			grid.SelectionMode = GridSelectionMode.Row;
			grid.Selection.EnableMultiSelection = false;
			
			// this method causes first row to be selected. Should not fail 
			// it failed once in RowSelection.SelectRow method
			// As call to ResetSelection asked to maintain focus, a stack overflow was raised
			grid.Selection.Focus(new Position(0, 0), false);
			
			// destroy
			form.Close();
			form.Dispose();
		}
Beispiel #16
0
 public GridRows(Grid grid)
     : base(grid)
 {
 }
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ListEditor));
			this.grid = new Grid();
            this.btDown = new System.Windows.Forms.Button();
            this.btUp = new System.Windows.Forms.Button();
            this.btRemove = new System.Windows.Forms.Button();
            this.btAdd = new System.Windows.Forms.Button();
            this.btrRefreshList = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// grid
			// 
			this.grid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.grid.AutoStretchColumnsToFitWidth = false;
			this.grid.AutoStretchRowsToFitHeight = false;
			this.grid.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.grid.CustomSort = false;
			this.grid.Location = new System.Drawing.Point(4, 32);
			this.grid.Name = "grid";
			this.grid.Size = new System.Drawing.Size(332, 216);
			this.grid.SpecialKeys = GridSpecialKeys.Default;
			this.grid.TabIndex = 0;
			// 
			// btDown
			// 
			this.btDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btDown.Enabled = false;
			this.btDown.Image = ((System.Drawing.Image)(resources.GetObject("btDown.Image")));
			this.btDown.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.btDown.Location = new System.Drawing.Point(312, 4);
			this.btDown.Name = "btDown";
			this.btDown.Size = new System.Drawing.Size(24, 23);
			this.btDown.TabIndex = 1;
			this.btDown.Click += new System.EventHandler(this.btDown_Click);
			// 
			// btUp
			// 
			this.btUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btUp.Enabled = false;
			this.btUp.Image = ((System.Drawing.Image)(resources.GetObject("btUp.Image")));
            this.btUp.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.btUp.Location = new System.Drawing.Point(284, 4);
			this.btUp.Name = "btUp";
			this.btUp.Size = new System.Drawing.Size(24, 23);
			this.btUp.TabIndex = 2;
			this.btUp.Click += new System.EventHandler(this.btUp_Click);
			// 
			// btRemove
			// 
			this.btRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btRemove.Enabled = false;
			this.btRemove.Image = ((System.Drawing.Image)(resources.GetObject("btRemove.Image")));
            this.btRemove.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.btRemove.Location = new System.Drawing.Point(220, 4);
			this.btRemove.Name = "btRemove";
			this.btRemove.Size = new System.Drawing.Size(24, 23);
			this.btRemove.TabIndex = 3;
			this.btRemove.Click += new System.EventHandler(this.btRemove_Click);
			// 
			// btAdd
			// 
			this.btAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btAdd.Image = ((System.Drawing.Image)(resources.GetObject("btAdd.Image")));
            this.btAdd.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.btAdd.Location = new System.Drawing.Point(192, 4);
			this.btAdd.Name = "btAdd";
			this.btAdd.Size = new System.Drawing.Size(24, 23);
			this.btAdd.TabIndex = 4;
			this.btAdd.Click += new System.EventHandler(this.btAdd_Click);
			// 
			// btrRefreshList
			// 
			this.btrRefreshList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btrRefreshList.Image = ((System.Drawing.Image)(resources.GetObject("btrRefreshList.Image")));
            this.btrRefreshList.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.btrRefreshList.Location = new System.Drawing.Point(252, 4);
			this.btrRefreshList.Name = "btrRefreshList";
			this.btrRefreshList.Size = new System.Drawing.Size(24, 23);
			this.btrRefreshList.TabIndex = 5;
			this.btrRefreshList.Click += new System.EventHandler(this.btrRefreshList_Click);
			// 
			// ListEditor
			// 
			this.Controls.Add(this.btrRefreshList);
			this.Controls.Add(this.btAdd);
			this.Controls.Add(this.btRemove);
			this.Controls.Add(this.btUp);
			this.Controls.Add(this.btDown);
			this.Controls.Add(this.grid);
			this.Name = "ListEditor";
			this.Size = new System.Drawing.Size(340, 252);
			this.ResumeLayout(false);

		}
        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="ADataTableValuePartner"></param>
        /// <param name="ADataTableValueApplication"></param>
        /// <param name="AOfficeSpecificDataLabelUse"></param>
        private void InitialiseUserControlInternal(PDataLabelValuePartnerTable ADataTableValuePartner,
            PDataLabelValueApplicationTable ADataTableValueApplication,
            TOfficeSpecificDataLabelUseEnum AOfficeSpecificDataLabelUse)
        {
            // Set the delegate function in the logic System.Object (so it can call back).
            // This can not be done in procedure InitializeDelegateGetPartnerShortName because FLogic
            // does not yet exist then.
            // Set up Data Sets and Tables
            InitialiseDataStructures(ADataTableValuePartner, ADataTableValueApplication);

            // Set up screen logic
            FOfficeSpecificDataLabelUse = AOfficeSpecificDataLabelUse;
            FLocalDataLabelValuesGrid = grdLocalDataLabelValues;

            //PossiblySomethingToSave += new TTellGuiToEnableSaveButton([email protected]);

            // Set up Grid
            SetupGridColumnsAndRows();

            // Signalize that the initialisation is done
            FUserControlInitialised = true;
        }
 /// <summary>
 /// Needs to be called from the instantiator of this Class once it is
 /// done with using this class to ensure that no memory leak occurs!!!
 /// </summary>
 public void FreeStaticObjects()
 {
     FGridRowInfo = null;
     FLocalDataLabelValuesGrid = null;
 }
Beispiel #20
0
    private void RegisterContractList(IList<IBSimplefiedContract> list, Grid grid)
    {
      var i = 1;
      foreach (var c in list)
      {
        var contract = new IBContract
          {
            Currency = c.Currency,
            Symbol = c.Symbol,
            Exchange = c.Exchange,
            SecurityType = c.SecurityType,
            Expiry = c.Expiry,
            Multiplier = c.Multiplier.ToString(),
            Strike = c.Strike,
            Right = c.PutOrCall
          };

        _client.RequestMarketData(contract, null);
        _symbolDataMap.Add(contract, new InstrumentDataRecord() {Grid = grid, Row = i});
        i++;
      }
    }
 /// <summary>
 /// Creates a new GridAccessibleObject
 /// </summary>
 /// <param name="owner">Owner</param>
 public GridAccessibleObject(Grid owner) : base(owner)
 {
    grid = owner;
 }
Beispiel #22
0
    private void UpdateContractListFromGrid(IList<IBSimplefiedContract> contracts, Grid grid)
    {
      contracts.Clear();
      // The last row is always empty
      for (var i = 1; i < grid.Rows.Count - 1; i++) {        
        try {
          var contract = new IBSimplefiedContract {
            SecurityType = (IBSecurityType) grid[i, (int) IBGridColumn.SecType].Value,
            Currency = (string) grid[i, (int) IBGridColumn.Currency].Value,
            Exchange = (string) grid[i, (int) IBGridColumn.Exchange].Value,
            Symbol = (string) grid[i, (int) IBGridColumn.Symbol].Value,
            Rollover = (string) grid[i, (int) IBGridColumn.Rollover].Value,
            PutOrCall = (string) grid[i, (int) IBGridColumn.PutOrCall].Value
          };

          // SecurityType always has to be present...

          // String fields are always "safe"

          if (contract.SecurityType == IBSecurityType.FutureOption ||
              contract.SecurityType == IBSecurityType.Option) {
            contract.Expiry = (DateTime) grid[i, (int) IBGridColumn.Expiry].Value;
            contract.Strike = (double) grid[i, (int) IBGridColumn.Strike].Value;
            contract.Multiplier = (int) grid[i, (int) IBGridColumn.Multiplier].Value;
          }

          if (contract.SecurityType == IBSecurityType.FutureOption) {
            contract.Expiry = (DateTime) grid[i, (int) IBGridColumn.Expiry].Value;
            contract.Multiplier = (int) grid[i, (int) IBGridColumn.Multiplier].Value;
          }
          contracts.Add(contract);
        }
        catch (NullReferenceException)
        {
        }
      }
    }
Beispiel #23
0
 private void UpdateGridFromContractLists(IList<IBSimplefiedContract> contracts, Grid grid)
 {
   var i = 1;
   foreach (var contract in contracts)
   {
     SetupMarketDataGridRow(grid, i);
     grid[i, (int) IBGridColumn.Symbol].Value = contract.Symbol;
     grid[i, (int) IBGridColumn.SecType].Value = contract.SecurityType;
     grid[i, (int) IBGridColumn.Expiry].Value = contract.Expiry;
     grid[i, (int) IBGridColumn.Rollover].Value = contract.Rollover;
     grid[i, (int) IBGridColumn.Strike].Value = contract.Strike;
     grid[i, (int) IBGridColumn.PutOrCall].Value = contract.PutOrCall;
     grid[i, (int) IBGridColumn.Multiplier].Value = contract.Multiplier;
     grid[i, (int) IBGridColumn.Exchange].Value = contract.Exchange;
     grid[i, (int) IBGridColumn.Currency].Value = contract.Currency;
     i++;
   }
   SetupMarketDataGridRow(grid, i);
   grid.AutoSizeCells();
 }
        private void MakeNewTable(string name)
        {
            if (tabContainer.InvokeRequired)
            {
                MakeTab d = new MakeTab(MakeNewTable);
                this.Invoke(d, new object[] { name });
            }
            else
            {
                Grid formatProvider = null;
                if (grids.Count == 0)
                {
                    formatProvider = grid1;
                }
                else
                {
                    formatProvider = (Grid)grids[0];
                }

                var newPage = new TabPage(name);
                newPage.Name = name;
                var newGrid = new Grid();
                newGrid.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;

                newGrid.Parent = newPage;
                newGrid.BackColor = formatProvider.BackColor;
                newGrid.BorderStyle = formatProvider.BorderStyle;
                newGrid.Bounds = formatProvider.Bounds;
                newGrid.ForeColor = formatProvider.ForeColor;
                newGrid.Location = formatProvider.Location;
                tabContainer.TabPages.Add(newPage);
                grids.Add(newGrid);

                if (grids.Count != tabContainer.TabPages.Count)
                {
                    tabContainer.TabPages.RemoveAt(0);
                }
            }
        }
Beispiel #25
0
    private void SetupMarketDataGridRow(Grid grid, int r)
    {
      if (grid.Rows.Count <= r)
      {
        grid.Rows.Insert(r);
      }
      for (var i = 0; i <= (int) LAST_CONTRACT_DETAILS_COLUMN; i++)
      {
        Type t = grid[1, (int) i].Tag as Type;
        grid[r, i] = new SourceGrid.Cells.Cell(null, t) {
          Tag = t, 
          View = _yellowView
        };
      }

      for (var i = (int) LAST_CONTRACT_DETAILS_COLUMN + 1; i < (int) IBGridColumn.LAST_COLUMN; i++) {
        var cell = new SourceGrid.Cells.Cell(0.0);
        grid[r, i] = cell;
        var alternate = (r%2 != 0);
        if (i <= (int) LAST_STATUS_DETAILS_COLUMN)
          cell.View = alternate ? _lightGreen : _darkGreen;
        else
          cell.View = alternate ? _whiteView : _lightGray;
      }
      grid.Rows[r].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize;
    }
Beispiel #26
0
		public GridColumns(Grid grid)
			: base(grid)
		{
		}
        private void SetColumnsAndRows(string[] columns, string[] rows, Grid grid)
        {
            if (grid.InvokeRequired)
            {
                SetNumberOfColumnsAndRows d = SetColumnsAndRows;
                Invoke(d, columns, rows, grid);
            }
            else
            {

                grid.Rows.Clear();
                grid.Columns.Clear();

                grid.Rows.Insert(0);
                grid.Columns.Insert(0);

                for (int row = 1; row <= rows.Length; row++)
                {
                    grid.Rows.Insert(row);
                    grid[row, 0] = new RowHeader(rows[row - 1]);

                    for (int column = 1; column <= columns.Length; column++)
                    {
                        if (row == 1)
                        {
                            grid.Columns.Insert(column);
                            grid[0, column] =
                                new SourceGrid.Cells.ColumnHeader(columns[column - 1]);
                        }

                        grid[row, column] = new Cell();
                        grid[row, column].View = new SourceGrid.Cells.Views.Cell();
                    }
                }

                grid.AutoSizeCells();

            }
        }
		public void AreSpannedCells_CorrectlyRemoved()
		{
			SourceGrid.Grid grid1 = new Grid();
			grid1.Redim(2, 2);
			
			grid1[0, 0] = new Cell();
			grid1[0, 0].ColumnSpan = 2;
			grid1[0, 0] = null;
			
			// this should be true. But is not, at the moment of writing
			Assert.AreEqual(null, grid1.GetCell(0, 1));
			// this should not throw exception
			grid1[0, 1] = new Cell("my new cell");
		}
		public void InsertNullCell()
		{
			SourceGrid.Grid grid1 = new Grid();
			grid1.Redim(2, 2);
			
			// this should not throw exception
			grid1[0, 0] = null;
		}
Beispiel #30
0
 private void SetupMarketDataGridColumns(Grid grid)
 {
   var secType = (IBSecurityType) grid.Tag;
   if (secType == IBSecurityType.FutureOption || secType == IBSecurityType.Option) 
     return;
   grid.Columns[(int) IBGridColumn.AskDelta].Visible = false;
   grid.Columns[(int) IBGridColumn.BidDelta].Visible = false;
   grid.Columns[(int) IBGridColumn.BidImpVol].Visible = false;
   grid.Columns[(int) IBGridColumn.AskImpVol].Visible = false;
   grid.Columns[(int) IBGridColumn.Delta].Visible = false;
   grid.Columns[(int) IBGridColumn.Volatility].Visible = false;
   grid.Columns[(int) IBGridColumn.Price].Visible = false;
   grid.Columns[(int) IBGridColumn.PVDividend].Visible = false;
 }