Show arrow in DropDownList ComboBox at all times

Sep 21, 2010 at 3:39 PM
Edited Sep 21, 2010 at 3:39 PM

Using SourceGrid 4.22 and can't figure out how to show the arrow to identify that a cell is a DropDownList ComboBox at all times.

I would like it to display like the standard DropDownList ComboBox control in windows (see image below with highlighted area)

Here is sample code to duplicate this:

		string[] values = new string[] { "1", "2", "3" };

		grid1.BorderStyle = BorderStyle.FixedSingle;
		grid1.ColumnsCount = 3;
		grid1.FixedRows = 1;
		grid1.RowsCount = 5;
		grid1.Rows.Insert(0);

		grid1[0, 0] = new SourceGrid.Cells.ColumnHeader("header 1");
		grid1[0, 1] = new SourceGrid.Cells.ColumnHeader("header 2");
		grid1[0, 2] = new SourceGrid.Cells.ColumnHeader("dropdown");

		for (int i = 1; i < 5; i++)
		{
			grid1[i, 0] = new SourceGrid.Cells.Cell("test");
			grid1[i, 1] = new SourceGrid.Cells.Cell("test");

			SourceGrid.Cells.Editors.ComboBox combo = new SourceGrid.Cells.Editors.ComboBox(typeof(string));
			combo.StandardValues = values;
			combo.EditableMode = SourceGrid.EditableMode.Focus | SourceGrid.EditableMode.SingleClick | SourceGrid.EditableMode.AnyKey;
			combo.Control.DropDownStyle = ComboBoxStyle.DropDownList;
			grid1[i, 2] = new SourceGrid.Cells.Cell("", combo);
		}


		grid1.ClipboardMode = SourceGrid.ClipboardMode.All;
		grid1.AutoStretchColumnsToFitWidth = true;
		grid1.Columns.StretchToFit();
		grid1.AutoSizeCells();
		grid1.Refresh();
		grid1.Visible = true;

 

 

Any help would be appreciated!

update: Also, I'm using Windows 7 64-bit (but I see the same results on XP)

Sep 24, 2010 at 3:11 PM
Edited Sep 24, 2010 at 3:11 PM

try
grid1[i, 2].View = SourceGrid.Cells.Views.ComboBox.Default

Sep 24, 2010 at 3:48 PM

thanks lulalala!  that worked