Autocompletebox Bug after reopen the form?

8 posts, 0 answers
  1. Rafael
    Rafael avatar
    12 posts
    Member since:
    Jan 2011

    Posted 07 Apr 2014 Link to this post

    Hi, 

    I've developed a windowsform application where the user build a filter using autocompletebox components.
    This webform is called by the showdialog function. It works fine, but, when I reopen the form, the autocompletebox brings 2 values when I've set just one. It duplicates the value, and then I have 1 TokenizedTextItem and 1 text, as you can see on the prinscreens.

    The first print is my selection on first time, and the second print, is when I reopen the form.

  2. George
    Admin
    George avatar
    500 posts

    Posted 10 Apr 2014 Link to this post

    Hello Rafael,

    Thank you for contacting us.

    Can you please elaborate you current case? I tried to reproduce the problem locally but I am not sure that I tried correctly. Can you explain in details what steps I need to take in order to be able to see this effect on my end and more specifically how do you reopen the form? I tried with:
    void Button_Click(object sender, EventArgs e)
    {
        this.Hide();
        this.Show();
    }

    Looking forward to your reply.

    Regards,
    George
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Rafael
    Rafael avatar
    12 posts
    Member since:
    Jan 2011

    Posted 10 Apr 2014 in reply to George Link to this post

    Something like that:
    1.Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
    2.    frmBuscaAvancada.ShowDialog(True)
    3.End sub
  5. Rafael
    Rafael avatar
    12 posts
    Member since:
    Jan 2011

    Posted 10 Apr 2014 Link to this post

    I use it on a showDialog, then, on the first time it works fine, but, after closing and opening again like as showDialog, It brings the past value duplicated, like in the printscreens.
  6. Robert Schoen
    Robert Schoen avatar
    17 posts
    Member since:
    Sep 2008

    Posted 10 Apr 2014 in reply to Rafael Link to this post

    Normally after I used a dialog I destroy it.    Can you create your dialog box just prior to showing it then set it to null once you have your input values?

    1.Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
        frmBuscaAvancada = new MyDialogForm
    2. frmBuscaAvancada.ShowDialog(True);
         myval = frmBuscaAvancada.val;
        frmBuscaAvancada = null;
    3.End sub
  7. Rafael
    Rafael avatar
    12 posts
    Member since:
    Jan 2011

    Posted 11 Apr 2014 in reply to Robert Schoen Link to this post

    But, I realy need to keep the previously values on there....
    1.Public Class frmSchool
    2.  Dim pesquisa As New frmBuscaAvancada
    3.  Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
    4.    Dim queryAvancada As String = pesquisa.ShowDialog(True)
    5.  End Sub
    6.End Class
  8. George
    Admin
    George avatar
    500 posts

    Posted 15 Apr 2014 Link to this post

    Hi Guys,

    Thank you for you replies.

    Rafael, I am still not able to reproduce the described behavior on my end. Can you please provide me with a sample project where the problem is reproducible? Additionally I have attached a project which I used for my tests. You can modify it and send it back. 

    Looking forward to your reply.

    Regards,
    George
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  9. Rafael
    Rafael avatar
    12 posts
    Member since:
    Jan 2011

    Posted 22 Apr 2014 in reply to George Link to this post

    It's working now.
    I had some events on autocomplet textbox that was causing the problem.
    After test with your project I could identify and fix my code.

    Thanx, and sorry about that.
Back to Top
UI for WinForms is Visual Studio 2017 Ready