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

Grid combobox value changing

2 Answers 102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Peter Szintai
Top achievements
Rank 1
Peter Szintai asked on 27 Jun 2011, 01:15 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Alexander
Telerik team
answered on 30 Jun 2011, 12:35 PM
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!
0
Peter Szintai
Top achievements
Rank 1
answered on 30 Jun 2011, 12:46 PM
Dear Alexander,

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

Best regards,

Peter
Tags
GridView
Asked by
Peter Szintai
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Peter Szintai
Top achievements
Rank 1
Share this question
or