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

Excel Addin SelectedItem gets nulled/destroyed

8 Answers 38 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 19 May 2016, 04:23 PM

Hello,

there seems to be a problem with the DropDownList (latest version, the last 2015 version worked fine) when used inside a Excel AddIn.

A demo project is attached (not a png it's a zip file), you need Excel 2013 or 2016 installed to debug the demo project.

When you run this, there is a new ribbon tab in the Excel (tab2) and a new button (button1) to click.

If you take the same code from the RadForm2 and make a new WinForms Project and do the same thing as in the Excel AddIn, the code works fine.

 

Kind Regards,

Christian

 

8 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 May 2016, 10:07 AM
Hello Christian,

Thank you for writing. 

I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to set the DropDownStyle property to RadDropDownStyle.DropDownList.

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Christian
Top achievements
Rank 1
answered on 24 May 2016, 03:04 PM

Hello Dess,

thank you for your answer. Do you have any idea what change since the last 2015 version could be the reason for this problem? I've the old source codes so I could diff them (but without knowing in what direction to look there are to many changes) maybe I could fix it myself. The workaround is OK, but in some cases it's not possible for me to change it because the user is allowed to select or enter whatever they like.

Kind Regards,

Christian

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 27 May 2016, 11:22 AM
Hello Christian,

Thank you for writing back. 
 
Note that MS Office AddIn has a specific environment which has a different messages lifecycle. Excel sends WM message to the textbox which clears the text. This behavior is not observed in a standard WindowsForms environment. The behavior is changed in Q3 2015 SP1 (version 2015.3.1104) when introducing a fix for the following feedback item: http://feedback.telerik.com/Project/154/Feedback/Details/171100-fix-raddropdownlist-the-autocomplete-does-not-work-when-some-text-is-pasted

Since it seems to be a problem of Excel, we need some more to investigate the problem and we will do our best to introduce a fix as soon as possible. Meanwhile, you can use an alternative solution by setting the DropDownListElement.SyncSelectionWithText property to false.

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Christian
Top achievements
Rank 1
answered on 30 May 2016, 08:11 AM

Hello Dess,

never had the 2015.3.1104 installed, so no wonder I missed this change. (did upgrade from 2015.3.930 to 2016.2.503).

Setting SyncSelectionWithText works, so I'm good for now!

0
Christian
Top achievements
Rank 1
answered on 30 May 2016, 02:48 PM

Hello Dess,

unfortunately I've found another bug which I think is somehow related to the same problem. Maybe it's already fixed with your proposed change for the 2016 SP1.

I've updated the sample project. There is a RadGridView with enabled filtering. To reproduce you have to use one of the filters which opens a filter dialog which have a RadDropDownList. So "Available filters" ... "starts with" ... and then with or without entering any filter value close or cancel the dialog.

This results in a System.InvalidOperationException "Control ... accessed from a thread other than the thread it was created on."

Form the Exception/Callstack:

bei System.Windows.Forms.Control.get_Handle()
bei System.Windows.Forms.TextBox.ResetAutoComplete(Boolean force)
bei System.Windows.Forms.TextBox.Dispose(Boolean disposing)
bei System.ComponentModel.Component.Dispose()
bei System.Windows.Forms.Control.Dispose(Boolean disposing)
bei Telerik.WinControls.RadControl.Dispose(Boolean disposing)
bei Telerik.WinControls.UI.RadDropDownList.Dispose(Boolean disposing)

 

Kind Regards,

Christian

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 31 May 2016, 11:52 AM
Hello Christian,

Thank you for writing back. 
 
The provided sample project is greatly appreciated. This exception is related to the already reported issue for RadDropDownList. I have already tested the project with the fix and the error doesn't occur.

Off topic, I have noticed that you set the EnableCustomFilter property to true without handling the CustomFiltering event. Thus, the filtering functionality won't work. Please refer to the following help article demonstrating how to setup the custom filtering: http://docs.telerik.com/devtools/winforms/gridview/filtering/custom-filtering

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Christian
Top achievements
Rank 1
answered on 01 Jun 2016, 06:48 AM

Hello Dess,

good to hear that the problems are related and second one is also fixed.

In the sample project I had to try what's the right property (there are quite some for filtering ;) ). That's why the EnableCustomFilter is enabled. But thank's for catching this and letting me know.

Kind Regards,

Christian

0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Jun 2016, 08:46 AM
Hello Christian,

Thank you for writing back. 

In order to enable the basic filtering, it is necessary to set the EnableFiltering property to true. As to the custom filtering functionality, the relevant property is EnableCustomFiltering. The following help articles are quite useful about the two filtering behaviors that RadGridView supports:
http://docs.telerik.com/devtools/winforms/gridview/filtering/basic-filtering
http://docs.telerik.com/devtools/winforms/gridview/filtering/custom-filtering

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
DropDownList
Asked by
Christian
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Christian
Top achievements
Rank 1
Share this question
or