GridViewComboBoxColumn - DropDownArrow click event

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

    Posted 15 Apr 2013 Link to this post

    Hello guys,

    in my GridView i have a ComboBoxColumn. Is it possible to fire an event when someone clicks on the DropDownArrow ? In addititon the DropDownList should not open because i want to open a new form to select values.

    thanks in advance

    Markus
  2. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 18 Apr 2013 Link to this post

    Hi Markus,

    Thank you for writing.

    Before getting to your question I would like to discuss your license with you. Please note, that in order to continue receiving support from Telerik representatives, you have to be added as Licensed developer to an active license with support subscription. I can see that in your account you have such a license and it is assigned to d.neetix@grolman-group.com. If you are also working with our controls, you should consider a purchase of an additional license, and assign yourself as license developer to it.

    I have converted this forum thread into a support ticket in order to prevent disclosure of private information. You can find it in your Telerik account.

    As to your question at hand, you can use the CellEditorInitialized event, where you can access the editor of the combo column. Once you access it, you can use its PopupOpening event to prevent the opening of the dropdown, and use the Click event of the ArrowButton to open your form:
    void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        if (e.Column.Name == "ComboColumn")
        {
            RadDropDownListEditor editor = (RadDropDownListEditor)e.ActiveEditor;
            RadDropDownListEditorElement element = (RadDropDownListEditorElement)editor.EditorElement;
            element.PopupOpening += element_PopupOpening;
            element.ArrowButton.Click += ArrowButton_Click;
        }
    }
     
    void ArrowButton_Click(object sender, EventArgs e)
    {
        //do smth
    }
     
    void element_PopupOpening(object sender, CancelEventArgs e)
    {
        e.Cancel = true;
    }

    I hope that you find this information useful. Let me know if you have any other questions.
     
    Regards,
    Stefan
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.

Back to Top