예제 #1
0
        // Constructor
        public DataGrid()
        {
//			Console.WriteLine("DataGrid.constr");

            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            initializing = true;
            gridTableStylesCollection = new GridTableStylesCollection();
            gridTableStylesCollection.Add(new DataGridTableStyle());
            dgforeColor              = SystemColors.WindowText;
            backgroundColor          = SystemColors.Window;
            headerForeColor          = SystemColors.WindowText;
            hScrollBar               = new HScrollBar();
            hScrollBar.Visible       = false;
            hScrollBar.Dock          = DockStyle.Bottom;
            hScrollBar.TabStop       = false;
            hScrollBar.ValueChanged += new EventHandler(GridHScrolled);
            vScrollBar               = new VScrollBar();
            vScrollBar.Visible       = false;
            vScrollBar.Dock          = DockStyle.Right;
            vScrollBar.TabStop       = false;
            vScrollBar.ValueChanged += new EventHandler(GridVScrolled);
            Controls.Add(vScrollBar);
            Controls.Add(hScrollBar);
        }
예제 #2
0
		public DataGrid ()
		{
			allow_navigation = true;
			background_color = def_background_color;
			border_style = BorderStyle.Fixed3D;
			caption_backcolor = def_caption_backcolor;
			caption_forecolor = def_caption_forecolor;
			caption_text = string.Empty;
			caption_visible = true;
			datamember = string.Empty;
			parent_rows_backcolor = def_parent_rows_backcolor;
			parent_rows_forecolor = def_parent_rows_forecolor;
			parent_rows_visible = true;
			current_cell = new DataGridCell ();
			parent_rows_label_style = DataGridParentRowsLabelStyle.Both;
			selected_rows = new Hashtable ();
			selection_start = -1;
			rows = new DataGridRelationshipRow [0];

			grid_style_stack = new Stack ();
			data_grid_table_style_stack = new Stack ();
			default_style = new DataGridTableStyle (true);
			grid_style = new DataGridTableStyle ();

			styles_collection = new GridTableStylesCollection (this);
			styles_collection.CollectionChanged += new CollectionChangeEventHandler (OnTableStylesCollectionChanged);

			CurrentTableStyle = grid_style;

			horiz_scrollbar = new ImplicitHScrollBar ();
			horiz_scrollbar.Scroll += new ScrollEventHandler (GridHScrolled);
			vert_scrollbar = new ImplicitVScrollBar ();
			vert_scrollbar.Scroll += new ScrollEventHandler (GridVScrolled);

			SetStyle (ControlStyles.UserMouse, true);

			data_source_stack = new Stack ();

			back_button_image = ResourceImageLoader.Get ("go-previous.png");
			back_button_image.MakeTransparent (Color.Transparent);
			parent_rows_button_image = ResourceImageLoader.Get ("go-top.png");
			parent_rows_button_image.MakeTransparent (Color.Transparent);
		}
 /// <summary>
 /// Returns an observable sequence wrapping the CollectionChanged event on the GridTableStylesCollection instance.
 /// </summary>
 /// <param name="instance">The GridTableStylesCollection instance to observe.</param>
 /// <returns>An observable sequence wrapping the CollectionChanged event on the GridTableStylesCollection instance.</returns>
 public static IObservable <EventPattern <CollectionChangeEventArgs> > CollectionChangedObservable(this GridTableStylesCollection instance)
 {
     return(Observable.FromEventPattern <CollectionChangeEventHandler, CollectionChangeEventArgs>(
                handler => instance.CollectionChanged += handler,
                handler => instance.CollectionChanged -= handler));
 }
예제 #4
0
		// Constructor
		public DataGrid()
		{
//			Console.WriteLine("DataGrid.constr");

			SetStyle(ControlStyles.ResizeRedraw,true);
			SetStyle(ControlStyles.DoubleBuffer, true);
			initializing = true;
			gridTableStylesCollection= new GridTableStylesCollection();
			gridTableStylesCollection.Add(new DataGridTableStyle());
			dgforeColor = SystemColors.WindowText;
			backgroundColor = SystemColors.Window;
			headerForeColor = SystemColors.WindowText;
			hScrollBar = new HScrollBar();
			hScrollBar.Visible = false;
			hScrollBar.Dock = DockStyle.Bottom;
			hScrollBar.TabStop = false;
			hScrollBar.ValueChanged += new EventHandler(GridHScrolled);
			vScrollBar = new VScrollBar();
			vScrollBar.Visible = false;
			vScrollBar.Dock = DockStyle.Right;
			vScrollBar.TabStop = false;
			vScrollBar.ValueChanged += new EventHandler(GridVScrolled);
			Controls.Add(vScrollBar);
			Controls.Add(hScrollBar);
		}
		public void DumpGridTableStylesCollection (GridTableStylesCollection ts)
		{
			Console.WriteLine ("IsSynchronized {0} ", ts.IsSynchronized);
			Console.WriteLine ("SyncRoot {0} ", ts.SyncRoot);
			Console.WriteLine ("IsReadOnly {0} ", ts.IsReadOnly);
		}
 public DataGrid()
 {
     base.SetStyle(ControlStyles.UserPaint, true);
     base.SetStyle(ControlStyles.Opaque, false);
     base.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
     base.SetStyle(ControlStyles.UserMouse, true);
     this.gridState = new BitVector32(0x42827);
     this.dataGridTables = new GridTableStylesCollection(this);
     this.layout = this.CreateInitialLayoutState();
     this.parentRows = new DataGridParentRows(this);
     this.horizScrollBar.Top = base.ClientRectangle.Height - this.horizScrollBar.Height;
     this.horizScrollBar.Left = 0;
     this.horizScrollBar.Visible = false;
     this.horizScrollBar.Scroll += new ScrollEventHandler(this.GridHScrolled);
     base.Controls.Add(this.horizScrollBar);
     this.vertScrollBar.Top = 0;
     this.vertScrollBar.Left = base.ClientRectangle.Width - this.vertScrollBar.Width;
     this.vertScrollBar.Visible = false;
     this.vertScrollBar.Scroll += new ScrollEventHandler(this.GridVScrolled);
     base.Controls.Add(this.vertScrollBar);
     this.BackColor = DefaultBackBrush.Color;
     this.ForeColor = DefaultForeBrush.Color;
     this.borderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.currentChangedHandler = new EventHandler(this.DataSource_RowChanged);
     this.positionChangedHandler = new EventHandler(this.DataSource_PositionChanged);
     this.itemChangedHandler = new ItemChangedEventHandler(this.DataSource_ItemChanged);
     this.metaDataChangedHandler = new EventHandler(this.DataSource_MetaDataChanged);
     this.dataGridTableStylesCollectionChanged = new CollectionChangeEventHandler(this.TableStylesCollectionChanged);
     this.dataGridTables.CollectionChanged += this.dataGridTableStylesCollectionChanged;
     this.SetDataGridTable(this.defaultTableStyle, true);
     this.backButtonHandler = new EventHandler(this.OnBackButtonClicked);
     this.downButtonHandler = new EventHandler(this.OnShowParentDetailsButtonClicked);
     this.caption = new DataGridCaption(this);
     this.caption.BackwardClicked += this.backButtonHandler;
     this.caption.DownClicked += this.downButtonHandler;
     this.RecalculateFonts();
     base.Size = new Size(130, 80);
     base.Invalidate();
     base.PerformLayout();
 }