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?
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
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.
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