We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Two NumericUpDown control ina single cell

Thread ID:

Created:

Updated:

Platform:

Replies:

21064 Nov 1,2004 09:09 PM Nov 2,2004 01:38 AM Windows Forms 2
loading
Tags: GridControl
Thiyagu
Asked On November 1, 2004 09:09 PM

Hi Clay, Is it possible to have a two NumericUpDown Control in a single cell?.. Thiyagu.

Administrator [Syncfusion]
Replied On November 2, 2004 12:55 AM

If you want just one cell like this (so no control sharing across multiple grid cells), then the easiest thing to do is to create a panel that holds your two instances of NumericUpDowns, an dthen use the Control cellType to display the panel in a cell. Below is some code. If you want to have this control in several cells, then you would have to derive a cell control to do this. One way to do this is shown in the Grid\Samples\In Depth\DropDownFormAndUserControlSample sample. Panel box = new Panel(); NumericUpDown ud1 = new NumericUpDown(); NumericUpDown ud2 = new NumericUpDown(); //stack them from the left ud1.Dock = DockStyle.Left; ud2.Dock = DockStyle.Left; ud1.Width = 30; ud2.Width= 30; ud1.BorderStyle = BorderStyle.FixedSingle; ud2.BorderStyle = BorderStyle.FixedSingle; box.Controls.AddRange(new Control[]{ud1, ud2}); box.BorderStyle = BorderStyle.None; gridControl1.RowHeights[2] = 20; gridControl1.ColWidths[2] = 64; gridControl1[2,2].CellType = "Control"; gridControl1[2,2].Control = box; this.Controls.Add(box);

Thiyagu
Replied On November 2, 2004 01:38 AM

Thanks Clay. Thank you very much. >If you want just one cell like this (so no control sharing across multiple grid cells), then the easiest thing to do is to create a panel that holds your two instances of NumericUpDowns, an dthen use the Control cellType to display the panel in a cell. Below is some code. > >If you want to have this control in several cells, then you would have to derive a cell control to do this. One way to do this is shown in the Grid\Samples\In Depth\DropDownFormAndUserControlSample sample. > > > >Panel box = new Panel(); >NumericUpDown ud1 = new NumericUpDown(); >NumericUpDown ud2 = new NumericUpDown(); >//stack them from the left >ud1.Dock = DockStyle.Left; >ud2.Dock = DockStyle.Left; >ud1.Width = 30; >ud2.Width= 30; >ud1.BorderStyle = BorderStyle.FixedSingle; >ud2.BorderStyle = BorderStyle.FixedSingle; >box.Controls.AddRange(new Control[]{ud1, ud2}); > >box.BorderStyle = BorderStyle.None; >gridControl1.RowHeights[2] = 20; >gridControl1.ColWidths[2] = 64; >gridControl1[2,2].CellType = "Control"; >gridControl1[2,2].Control = box; >this.Controls.Add(box); >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;