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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ComboBox Column ReadOnly

Thread ID:





28935 May 12,2005 04:17 PM UTC Jun 9,2005 12:23 AM UTC WinForms 4
Tags: GridControl
Prof DISSOU Jamâl-Dine
Asked On May 12, 2005 04:17 PM UTC

Hi, Please let me know, how to make a ComboBox Column ReadOnly. Best regrads, Jamâl-Dine DISSOU

Prof DISSOU Jamâl-Dine
Replied On May 12, 2005 04:23 PM UTC

Hi, I mean how to make a ComboBox Column in GGC (GridGroupingControl). Best regards, Jamâl-Dine

Administrator [Syncfusion]
Replied On May 13, 2005 11:43 AM UTC

I am not sure I understand exactly what you need to be readonly. To make a column readonly, you can set this.gridGroupingControl1.TableDescriptor.Columns["SomeColumn"].ReadOnly = true; If you want to restrict your user to only selecting values in the combobox list, then on the style object where you are setting, style.CellType = "ComboBox", style.DataSource = ???, etc., also set style.DropDownStyle = GridDropDownStyle.Exclusive.

Administrator [Syncfusion]
Replied On June 8, 2005 05:04 PM UTC

I think original poster has the same problem as me. I have a combobox readonly column created in GGC. It seems to be working fine - I cannot type anything in it (dropdown button is hidden). However double-clicking the cell causes values to change. I can probably override double-click event, but may be there is a better way? Below is the sample of how I create 1 column. gridColumnDescriptor.MappingName = column; gridColumnDescriptor.HeaderText = captionText; gridColumnDescriptor.ReadOnly = true; gridColumnDescriptor.Appearance.AnyRecordFieldCell.BaseStyle = ""; gridColumnDescriptor.Appearance.AnyRecordFieldCell.CellType = "ComboBox"; gridColumnDescriptor.Appearance.AnyRecordFieldCell.DataSource = dataSource; gridColumnDescriptor.Appearance.AnyRecordFieldCell.DisplayMember = displayMember; gridColumnDescriptor.Appearance.AnyRecordFieldCell.ValueMember = valueMember; gridColumnDescriptor.Appearance.AnyRecordFieldCell.HorizontalAlignment = GridHorizontalAlignment.Left;

Administrator [Syncfusion]
Replied On June 9, 2005 12:23 AM UTC

In, there is a property you can set to avoid this behavior. GridComboBoxCellModel cellModel = grid.Model.CellModels["ComboBox"] as GridComboBoxCellModel; cellModel.AllowDoubleClickChangeSelectedIndex = false; In earlier versions, you need to derive the combobox celltype. When double clicked on a combobox cell, the OnEditPartMouseDown method of the combobox cell renderer is called that replaces it with the next item in the dropdown. To cancel it, for now you have to override the OnEditPartMouseDown deriving the cell renderer and cellmodel. Here is the modified sample that does it for read-only cells.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon