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

Using a combobox in a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

4725 May 28,2003 10:58 AM UTC Jun 3,2003 12:31 PM UTC WinForms 6
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 28, 2003 10:58 AM UTC

1) Is there a way to use a comboBbx in a cell without the user being able to chose other values than the ones is the combobox? I've tried setting ExclusiveChoiceList to true, but if you hit the Delete-button and press enter you are able to leave the cell blank! 2) Is there a way to have a ComboBox in a cell with the text in the cell being bold when it is collapsed, but without having the elements in the combobox shown as bold text, when it is "dropped down"... Sincerely, Kenneth

Administrator [Syncfusion]
Replied On May 28, 2003 06:49 PM UTC

> 1) Is there a way to use a comboBbx in a cell without the user being able to chose other values than the ones is the combobox? I've tried setting ExclusiveChoiceList to true, but if you hit the Delete-button and press enter you are able to leave the cell blank! > > 2) Is there a way to have a ComboBox in a cell with the text in the cell being bold when it is collapsed, but without having the elements in the combobox shown as bold text, when it is "dropped down"... > > Sincerely, > Kenneth 1) Try to listen to the ClearingCells event and set e.Cancel = true. 2) Try CurrentCellShowedDropDown. There you can then get to the dropped down listbox and change its font. Something like ComboBoxCellRenderer cr = CurrentCell.Renderer; cr.ListBoxPart.Font = new Font(xxx) Stefan

Administrator [Syncfusion]
Replied On May 28, 2003 08:33 PM UTC

1) The GridClearingCellsEventArgs doesn't have a Cancel-property... :( 2) You probably mean GridComboBoxRenderer... but anyway, I simply cannot make it work! I get no changes at all! Could you show a small example? Kenneth

Administrator [Syncfusion]
Replied On May 28, 2003 09:13 PM UTC

Attached is a sample that shows the text bold, but the combo droplist regular. It uses CurrentCellShowingDropDown to do this. The ClearingCells event args has an e.Handled that you set to indicate that you handled the clearing. In the attached sample, I added this event too, but it is not needed here as pressing Delete does not clear the cell. If you are using a GridDataBoundGrid, then that might explain the deleting problem, but setting e.Handled in ClearingCells should prevent this.

Charles Carlin
Replied On June 3, 2003 11:42 AM UTC

I am having the same problem. I added the ClearingCells event and set e.handled=true like in your example and the event is never fired when I press the delete key. This is in a databound grid control, with a combobox set to exclusive.

Administrator [Syncfusion]
Replied On June 3, 2003 12:03 PM UTC

ClearingCells is only hit when you select a range of cells. Pressing delete on an active cell will not fire it. What grid version are you using? With the 1.6 beta code, if I have ExclusiveChoiceList = true, then pressing delete on the combobox does not delete the entry. Attached is the little sample I used. If you want to try the 1.6 code base, you can submit a Direct Trac support incident and request it.

Charles Carlin
Replied On June 3, 2003 12:31 PM UTC

Actually I found that if I add the gridControl1_CurrentCellDeleting event and set e.canel=true along with the gridControl1_ClearingCells event e.handled=true then it does work.

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.

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

;