Grid combobox value changing

3 posts, 1 answers
  1. Peter Szintai
    Peter Szintai avatar
    28 posts
    Member since:
    Jul 2009

    Posted 27 Jun 2011 Link to this post

    Hi All,

    I have a grid, which contains some combobox column.

    Is there a way to catch the moment, when the user selected a new item from the dropdown list of a combobox column, but does not leave the column? (e.g.: similar to the SelectedIndexChanged event of the raddropdownlist control).

    Best regards,

    Peter
  2. Answer
    Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 30 Jun 2011 Link to this post

    Hello Peter,

    You can subscribe to the SelectedIndexChanged event of RadDropDownListEditor's element as demonstrated in this help article:
    this.radGridView1.CellEditorInitialized += new GridViewCellEventHandler(radGridView1_CellEditorInitialized);
     
    private bool tbSubscribed = false;
    private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        if (this.tbSubscribed)
        {
            return;
        }
     
        RadDropDownListEditor editor = this.radGridView1.ActiveEditor as RadDropDownListEditor;
        if (editor != null)
        {
            RadDropDownListEditorElement editorElement = (RadDropDownListEditorElement)editor.EditorElement;
            editorElement.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(editorElement_SelectedIndexChanged);
     
            this.tbSubscribed = true;
        }
    }
     
    private void editorElement_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
    {
    }

    I hope it helps.

    Kind regards,
    Alexander
    the Telerik team
    Registration for Q2 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting July 18th and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Peter Szintai
    Peter Szintai avatar
    28 posts
    Member since:
    Jul 2009

    Posted 30 Jun 2011 Link to this post

    Dear Alexander,

    it is the needed information, what I have looked for!

    Best regards,

    Peter
Back to Top