We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

buttonedit popup autocomplete function

Dear Sir :

Can I write a code in ButtonEditChildButton1.Click event function which can manual popup auto complete list 


Thanks

Michael

9 Replies

SK Senthil Kumaran Rajan Syncfusion Team August 6, 2015 09:41 AM UTC

Hi Michael,

Thank you for using Syncfusion products.

Yes, your requirement to display the AutoComplete upon ButtonEdit Child button click, can be achieved by using its ProcessAutoComplete function. Please make use of the below code snippet.


Code Snippet[C#]:


private void buttonEditChildButton1_Click(object sender, EventArgs e)

        {

            this.autoComplete1.ActiveFocusControl = this.textBoxExt2;

            //To show the autoCompletePopup

            this.autoComplete1.ProcessAutoComplete(this.textBoxExt2.Text, string.Empty, Point.Empty);

            this.autoComplete1.ActiveFocusControl = null;

        }



We have also prepared the sample for your reference and it can be downloaded from the below location.

Sample location : http://www.syncfusion.com/downloads/support/forum/119829/ze/ButtonEditAutoComplete92609859

Could you check with the attached sample and let us know whether the provided solution helps to achieve the reported requirement?

Please let us know if you need further assistance.

Regards,
Senthil



MK Michael K August 8, 2015 03:22 AM UTC

Hi Senthil:

Thanks for your sample, it great work, now I have another question, I would like to create the user control which combine buttonedit and autocomplete as one object
(such as comboboxautocomplete) is that possible ?

Thanks for your help

Michael


SK Senthil Kumaran Rajan Syncfusion Team August 9, 2015 01:35 PM UTC

Hi Michael,
 
Thank you for your update.
 
Yes, it is possible to create a custom control for the reported requirement by using ButtonEdit and AutoComplete control. Please make use of below code snippet for your reference.
 
Code Snippet[C#]:

//Change parent form of the autoComplete

this.autocomplete.ParentForm = this.ParentForm;

// Set DataSource.

this.buttonEditExt1.DataSource = view;

//To set DisplayMember

this.buttonEditExt1.DisplayMember = "place";

 

private object m_DataSource;

/// <summary>

/// Get/sets the DataSource for the ButtonEditExt

/// </summary>

  public object DataSource

   {

        get { return m_DataSource; }

        set

          {

               this.m_DataSource = value;

               //Change parent form of the UserControl

               this.autocomplete.ParentForm = this.ParentForm;

               this.autocomplete.DataSource = value;

                this.autocomplete.SetAutoComplete(this.TextBox, AutoCompleteModes.MultiSuggestExtended);

          }

  }

private string displayMember = string.Empty;

/// <summary>

/// Get/Sets the DisplayMember for the ButtonEditExt

/// </summary>

   public String DisplayMember

     {

         get { return displayMember; }

         set

          {

              this.displayMember = value;

              if(this.displayMember != string.Empty)

                  this.autocomplete.RefreshColumns();

              foreach(AutoCompleteDataColumnInfo column in this.autocomplete.Columns)

               {

                   if(column.ColumnName == value)

                    {

                        column.Visible = true;

                    }

                    else

                    {

                        column.Visible = false;

                    }

                }

            }

        }
 

 
We have also prepared the sample for your reference and it can be downloaded from the below location.
 
Sample Location : http://www.syncfusion.com/downloads/support/forum/119829/ze/ButtonAutoComplete959806754

Please let us know if you need further assistance.
 
Regards,
Senthil


MK Michael K August 10, 2015 03:46 AM UTC

Dear Senthil  :


Thanks for your provide sample. and I will write the code to enhance this buttonedit function

Thanks


SK Senthil Kumaran Rajan Syncfusion Team August 10, 2015 04:16 AM UTC

Hi Michael,

Thank you for your update.

We are glad to know that, your requirement has been achieved. Please let us know if you need any further assistance, we will be happy to assist you.

Regards,
Senthil


MK Michael K August 10, 2015 04:16 AM UTC

Hi Mr. Senthil :

While I open your sample , and try to drag this control on the form and we got the error as attach picture, 

any idea for that ?

Thanks

Michael

Attachment: error_01_f118d17b.zip


SK Senthil Kumaran Rajan Syncfusion Team August 10, 2015 06:59 AM UTC

Hi Michael,

Sorry for the inconvenience caused.

The reported behavior occurs, as ProcessAutoComplete function has been invoked during Design Time. Please make use of the below code snippet to resolve the reported behavior.

Code Snippet[C#]:

if (!this.DesignMode && this.autocomplete.DataSource != null)

            {

                this.autocomplete.ActiveFocusControl = this.TextBox;

                //To show the autoCompletePopup

                this.autocomplete.ProcessAutoComplete(this.TextBox.Text, string.Empty, Point.Empty);

            }


We have modified the sample for your reference and it can be downloaded from the below location.

Sample Location : http://www.syncfusion.com/downloads/support/forum/119829/ze/ButtonAutoComplete1415761008

Please let us know if you need further assistance.

Regards,
Senthil


MK Michael K August 10, 2015 09:59 AM UTC

Hi Sentil :

Well note and thanks

:)

Michael


SK Senthil Kumaran Rajan Syncfusion Team August 10, 2015 12:42 PM UTC

Hi Michael,

Thank you for your update.

We are glad to know that, your requirement has been achieved. Please let us know if you need any further assistance, we will be happy to assist you.

Regards,
Senthil

Loader.
Live Chat Icon For mobile
Up arrow icon