Capture text from combobox

4 posts, 0 answers
  1. Jeppe
    Jeppe avatar
    4 posts
    Member since:
    Sep 2012

    Posted 08 Nov 2011 Link to this post

    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

     

  2. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 08 Nov 2011 Link to this post

    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.

  3. Jeppe
    Jeppe avatar
    4 posts
    Member since:
    Sep 2012

    Posted 08 Nov 2011 Link to this post

    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
  4. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 11 Nov 2011 Link to this post

    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.

Back to Top