Unplanned
Last Updated: 13 Feb 2020 13:45 by ADMIN
Steve
Created on: 09 Feb 2020 06:33
Category: CommandBar
Type: Bug Report
0
RadCommandBar: ShowClearButton is not serialized for the CommandBarTextBox.TextBoxElement at design time

I set the ShowClearButton on the design-time but the clear button not displayed when I run the application.

However, it works fun when I set the ShowClearButton programatically.

            commandBarTextBox1.TextBoxElement.ShowClearButton = true;

Do you know why?

3 comments
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 13 Feb 2020 13:45

Hello, Steve,

Thank you for the provided clarification. It helped to understand better your scenario.

Indeed, if you set the TextBoxElement.ShowClearButton property at design time, it is not serialized in the Designer.cs file. 

I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments 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 property via code at run time.

        public RadForm1()
        {
            InitializeComponent();

             this.commandBarTextBox1.TextBoxElement.ShowClearButton = true;
        }

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Steve
Posted on: 11 Feb 2020 12:46

I'm sorry that you didn't understand my question.Of course, I know that the clear button will display only when there is text in the text box.

The problem I found was that when I set the property of a CommandBarTextBox through the properties panel (instead of writing a line of code), the function didn't work.

Please try to set ShowClearButton on the design view and run it.

Please refer to my screenshot.

ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 10 Feb 2020 06:21

Hello, Steve,   

Note that when you set the ShowClearButton property to true, it is expected that the clear button is shown when there is some text in the text box. If it is empty, the clear button is not shown as there is nothing for clearing. The following screenshots illustrate better what I mean:

 

I have also attached my sample project for your reference.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.