This is a migrated thread and some comments may be shown as answers.

Capture text from combobox

3 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jeppe
Top achievements
Rank 1
Jeppe asked on 08 Nov 2011, 01:26 PM
Hi.

My interpretation of a combo box is, that one can either select an element from a predefined list - or just enter a value directly.

However, the GridViewComboBoxColumn seems not to work this way. I do have:

 

 

RadDropDownListEditor le = (RadDropDownListEditor)this.MasterTemplate.ActiveEditor;

 

 

 

RadDropDownListEditorElement ee = (RadDropDownListEditorElement)le.EditorElement;

 

le.DropDownStyle =

 

RadDropDownStyle.DropDown;

 

ee.AutoCompleteMode =

 

AutoCompleteMode.None;

But whatever entered directly in the combo box disappears when I move to next column.

Is there a way to meet my expectations so if the user enters data directly, it'd be considered text and applied to the field when the editor closes.

I need this behaviour cause sometimes data has to be selected from a list - and sometimes they should be entered directly...

Jeppe

 

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 08 Nov 2011, 03:37 PM
Hello Jeppe,

Does your requirement include adding the typed text as a new value in the drop-down editor? If this is so, please refer to this help article which concerns the exact same case.

I hope this helps. Let me know if this is not what you are after.

Greetings,
Nikolay
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
Jeppe
Top achievements
Rank 1
answered on 08 Nov 2011, 03:48 PM
Hello Nikolay.

No - I do not want to expand the list. It's just the case that sometimes (for some rows in the grid - depends on other data) predefined texts exists in the database - and then one of theese should be selected (and thus I set the combostyle to a list), but sometimes no predefined texts exists - and there the user can just write whatever he wants. But the entered data will never be of interest in the list for any other row in the grid.

So what I need is to routeback the text entered in the combo box to my datafield.

Best regards,

Jeppe
0
Nikolay
Telerik team
answered on 11 Nov 2011, 02:31 PM
Hi Jeppe,

Generally speaking, RadGridView needs to have a value in the list of dropdown values in order to be able to save that value in the data cells. However, this behavior can be worked around by manually setting the typed text into the currently edited cell. Please refer to the attached project for additional information.

I hope this helps.

Kind regards,
Nikolay
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Tags
GridView
Asked by
Jeppe
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Jeppe
Top achievements
Rank 1
Share this question
or