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

Problem with RadDropDownListEditor in 2010 Q3. This problem doesn`t exist in 2010 Q2 SP2.

7 Answers 135 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raymond
Top achievements
Rank 1
Raymond asked on 15 Nov 2010, 11:59 AM

Hi

 

I have column GridViewTextBoxColumn.
For some rows I use
RadDropDownListEditor in this column. I have random issue that sometimes drop down list cannot be collapsed by mouse click I have to press enter to collapse drop down list. It works fine in Q2 SP2.

Very bad surprise...

Is there any workaround for this issue in Q3?

 

Regards

7 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 15 Nov 2010, 02:51 PM
Hello Raymond,

Can you please post some code so that it would be easier to replicate and find a solution for this problem.

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
Accepted
Raymond
Top achievements
Rank 1
answered on 15 Nov 2010, 03:41 PM

I prepared demo for you but in my demo it works fine J

I have problem only in my real form – in commercial product. It means that I must have some code that affects somehow drop down list editor in Q3 and doesn`t affect drop down editor in Q2 SP2. I cannot localize this code.

 It was very weird because I changed only dll files to Q3 and after this change I started having this problem.

Fortunately I found workaround, I did this:

private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    RadDropDownListEditor editor = (e.ActiveEditor as RadDropDownListEditor);
    if (editor != null)
    {
        RadDropDownListEditorElement editorElement = editor.EditorElement as RadDropDownListEditorElement;
        editorElement.Popup.MouseClick += new MouseEventHandler(Popup_MouseClick);
    }
}
  
void Popup_MouseClick(object sender, MouseEventArgs e)
{
    RadDropDownListEditor editor = radGridView1.ActiveEditor as RadDropDownListEditor;
    if (editor != null)
    
        RadDropDownListEditorElement editorElement = editor.EditorElement as RadDropDownListEditorElement;
        editorElement.ClosePopup();
    }
}

 

 



If you see similar problem and find solution please let me know, maybe I will be able to get rid of this workaround and use standard procedure.

Regards

0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 15 Nov 2010, 03:48 PM
Hello Raymond,

I did not experience this problem yet, but until i do, you can use this, it's easier to remove later:
private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    RadDropDownListEditor editor = (e.ActiveEditor as RadDropDownListEditor);
    if (editor != null)
    {
        RadDropDownListEditorElement editorElement = editor.EditorElement as RadDropDownListEditorElement;
        editorElement.Popup.MouseClick += delegate
        {
            if (!editorElement.IsPopupOpen)
            {
                return;
            }
 
            editorElement.ClosePopup();
        };
    }
}

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
Deborah
Top achievements
Rank 1
answered on 26 Nov 2010, 07:02 PM
For anyone doing this in VB, the code is shown below:
Dim editor As RadDropDownListEditor = TryCast(e.ActiveEditor, RadDropDownListEditor)
If editor IsNot Nothing Then
    Dim editorElement As RadDropDownListEditorElement = TryCast(editor.EditorElement, RadDropDownListEditorElement)
    AddHandler editorElement.Popup.MouseClick, Sub(s, ev)
                       If editorElement.IsPopupOpen Then
                                editorElement.ClosePopup()
                       End If
                    End Sub
End If


This seems to take care of the problem ... but I am not marking this as the answer because I am hoping that Telerik will actually fix the problem so this won't be necessary.
0
Emanuel Varga
Top achievements
Rank 1
answered on 26 Nov 2010, 07:05 PM
Hello Deborah,

I'm glad this solved your problem and you couldn't mark this as an answer in this thread even if you wanted to :P.

Have a great weekend,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
Nathaniel
Top achievements
Rank 1
answered on 13 May 2011, 04:24 PM
This workaround doesn't seem to work if the dropdown has a lot of elements and there is a scrollbar. As soon as the scrollbar is clicked, the MouseClick event fires and the dropdown is closed.
0
Stefan
Telerik team
answered on 18 May 2011, 04:23 PM
Hello Nathaniel,

Thank you for writing.

The purpose of this work around is to close the popup when it is being clicked - no matter where the scroll bar or somewhere else. As far as I understand when you click the scroll bar, your drop down is being closed. If you are using the code provided in this thread, this is the expected behavior. Otherwise, in order to avoid discussing different subjects in the same thread please open a new forum thread or support ticket (where you will get faster answer - according to your license - and you are able to attach sample projects) where you explain in details the experienced and the expected behavior.

We are looking forward to helping you.
 
Kind regards,
Stefan
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
Raymond
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Raymond
Top achievements
Rank 1
Deborah
Top achievements
Rank 1
Nathaniel
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or