ComboBox in Virtual Grid

I''m trying to use a combobox in a virtual grid with code like this in the QueryCellInfo event: e.Style.CellType = "ComboBox"; StringCollection sc = new StringCollection(); sc.Add("A"); sc.Add("B"); sc.Add("C"); e.Style.ChoiceList = sc; e.Style.DropDownStyle = GridDropDownStyle.Exclusive; e.Handled = true; The cell looks like a combobox but I just can''t seem to get it to activate. When I click on it I get no dropdown list. I''ve looked at all the likely properties of the grid (enabled, readonly, etc.) but to no avail.

4 Replies

AD Administrator Syncfusion Team December 19, 2005 04:40 AM UTC

Hi Ken, That has to work, please check out the same implementation in this sample. Best regards, Stanley


KL Ken Law December 20, 2005 09:06 PM UTC

The sample works fine. Maybe the problem is in the code generated by the designer - here it is: // // vgStationCounters // this.vgStationCounters.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Cell; this.vgStationCounters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.vgStationCounters.BackColor = System.Drawing.SystemColors.ControlText; gridBaseStyle1.Name = "Header"; gridBaseStyle1.StyleInfo.Borders.Bottom = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.None); gridBaseStyle1.StyleInfo.Borders.Left = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.None); gridBaseStyle1.StyleInfo.Borders.Right = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.None); gridBaseStyle1.StyleInfo.Borders.Top = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.None); gridBaseStyle1.StyleInfo.CellType = "Header"; gridBaseStyle1.StyleInfo.Font.Bold = true; gridBaseStyle1.StyleInfo.Interior = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, System.Drawing.Color.FromArgb(((System.Byte)(203)), ((System.Byte)(199)), ((System.Byte)(184))), System.Drawing.Color.FromArgb(((System.Byte)(238)), ((System.Byte)(234)), ((System.Byte)(216)))); gridBaseStyle1.StyleInfo.VerticalAlignment = Syncfusion.Windows.Forms.Grid.GridVerticalAlignment.Middle; gridBaseStyle2.Name = "Column Header"; gridBaseStyle2.StyleInfo.BaseStyle = "Header"; gridBaseStyle2.StyleInfo.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Center; gridBaseStyle3.Name = "Row Header"; gridBaseStyle3.StyleInfo.BaseStyle = "Header"; gridBaseStyle3.StyleInfo.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Left; gridBaseStyle3.StyleInfo.Interior = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Horizontal, System.Drawing.Color.FromArgb(((System.Byte)(203)), ((System.Byte)(199)), ((System.Byte)(184))), System.Drawing.Color.FromArgb(((System.Byte)(238)), ((System.Byte)(234)), ((System.Byte)(216)))); gridBaseStyle4.Name = "Standard"; gridBaseStyle4.StyleInfo.Font.Facename = "Tahoma"; gridBaseStyle4.StyleInfo.Font.Size = 11F; gridBaseStyle4.StyleInfo.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.Black); gridBaseStyle4.StyleInfo.TextColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224))); this.vgStationCounters.BaseStylesMap.AddRange(new Syncfusion.Windows.Forms.Grid.GridBaseStyle[] { gridBaseStyle1, gridBaseStyle2, gridBaseStyle3, gridBaseStyle4}); this.vgStationCounters.ColCount = 0; this.vgStationCounters.ColWidthEntries.AddRange(new Syncfusion.Windows.Forms.Grid.GridColWidth[] { new Syncfusion.Windows.Forms.Grid.GridColWidth(0, 35)}); this.vgStationCounters.EnterKeyBehavior = Syncfusion.Windows.Forms.Grid.GridDirectionType.None; this.vgStationCounters.ForeColor = System.Drawing.SystemColors.Control; this.vgStationCounters.Location = new System.Drawing.Point(200, 40); this.vgStationCounters.Name = "vgStationCounters"; this.vgStationCounters.Properties.BackgroundColor = System.Drawing.Color.Black; this.vgStationCounters.RowCount = 0; this.vgStationCounters.SelectCellsMouseButtonsMask = System.Windows.Forms.MouseButtons.None; this.vgStationCounters.Size = new System.Drawing.Size(568, 96); this.vgStationCounters.SmartSizeBox = false; this.vgStationCounters.TabIndex = 13; this.vgStationCounters.Text = "gridControl1"; this.vgStationCounters.QueryColCount += new Syncfusion.Windows.Forms.Grid.GridRowColCountEventHandler(this.vgStationCounters_QueryColCount); this.vgStationCounters.QueryColWidth += new Syncfusion.Windows.Forms.Grid.GridRowColSizeEventHandler(this.vgStationCounters_QueryColWidth); this.vgStationCounters.QueryRowCount += new Syncfusion.Windows.Forms.Grid.GridRowColCountEventHandler(this.vgStationCounters_QueryRowCount); this.vgStationCounters.QueryCellInfo += new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(this.vgStationCounters_QueryCellInfo); this.vgStationCounters.SaveCellInfo += new Syncfusion.Windows.Forms.Grid.GridSaveCellInfoEventHandler(this.vgStationCounters_SaveCellInfo); this.vgStationCounters.QueryRowHeight += new Syncfusion.Windows.Forms.Grid.GridRowColSizeEventHandler(this.vgStationCounters_QueryRowHeight);


ST stanleyj Syncfusion Team December 21, 2005 10:22 AM UTC

Hi Ken, Please comment out this code. this.vgStationCounters.SelectCellsMouseButtonsMask = System.Windows.Forms.MouseButtons.None; Best regards, Stanley


KL Ken Law December 24, 2005 05:33 PM UTC

Thanks - that did the trick.

Loader.
Up arrow icon