Search panel, clear search text with code

Posted by: bengt.petersson on 13 November 2018, 6:10 am EST

    • Post Options:
    • Link

    Posted 13 November 2018, 6:10 am EST

    Hi

    Is there a way to clear the search text with code ?

    I am not showing the search panel all the time, and when I am hiding the search panel it would be nice to clear any active searching with a command like MySearchPanel.ClearText etc.

  • Posted 13 November 2018, 10:21 am EST

    Found a way to clear the text:

    SearchPanel.ActiveControl.Text = “”

    I was about to ask the same thing about GroupPanel e.g. how to clear columns in the grouping panel by code.

    Solved it by setting .MaxGroups to 0

  • Posted 3 June 2020, 3:48 am EST

    Actually, my solution above doesn’t work all the time. So I still don’t know how to clear the search text.

    I have tried:

    SearchPanel.Controls(0).ResetText()

    SearchPanel.Controls(0).Text = “”

    etc.

  • Posted 4 June 2020, 1:06 am EST

    Hi Petersson,

    The following code snippet is working fine at our end.

    SearchPanel.Controls(0).Text = ""
    

    If this is not working fine at your end then you also try to do this another way as given below:

      Dim btn As C1Button = C1FlexGridSearchPanel1.Controls(1)
      btn.PerformClick()
    

    I have attached a sample implementing the same.

    If this does not help then please let us know and modify the sample accordingly.

    Regards,

    Prabhat Sharma.

    SearchPanelDemo.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels