Excel Addin SelectedItem gets nulled/destroyed

9 posts, 1 answers
  1. Christian
    Christian avatar
    21 posts
    Member since:
    May 2012

    Posted 19 May Link to this post

    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

     

  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 24 May Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Christian
    Christian avatar
    21 posts
    Member since:
    May 2012

    Posted 24 May in reply to Dess Link to this post

    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

  5. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 27 May Link to this post

    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_DESTROY 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.
  6. Christian
    Christian avatar
    21 posts
    Member since:
    May 2012

    Posted 30 May in reply to Dess Link to this post

    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!

  7. Christian
    Christian avatar
    21 posts
    Member since:
    May 2012

    Posted 30 May Link to this post

    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

  8. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 31 May Link to this post

    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.
  9. Christian
    Christian avatar
    21 posts
    Member since:
    May 2012

    Posted 01 Jun in reply to Dess Link to this post

    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

  10. Answer
    Dess
    Admin
    Dess avatar
    1601 posts

    Posted 01 Jun Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready