When the "x" is used it seems that AllowSearchRow is not set to false because the toggle button has then to be pressed twice to show up the search mask again.
Hello Dess,
thanks for the answer. This was exactly what i needed.
Hello, Dominik,
I would like to note that there are two close "X" buttons on the search row:
The close button marked in red is purposed to clear the content of the search input box. While the close button marked in green is expected just to hide the GridViewSearchRowInfo. It manages the visibility of the search row element. The AllowSearchRow property is not expected to be changed in this case as the developer can continue using the search API programmatically.
I have prepared a sample code snippet demonstrating how to you can enable/disable the search functionality in RadGridView when the close button is clicked:
public RadForm1()
{
InitializeComponent();
this.radGridView1.MasterView.TableSearchRow.PropertyChanged+=TableSearchRow_PropertyChanged;
}
private void TableSearchRow_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName=="IsVisible")
{
this.radGridView1.AllowSearchRow = this.radGridView1.MasterView.TableSearchRow.IsVisible;
}
}
private void radToggleButton1_ToggleStateChanged(object sender, StateChangedEventArgs args)
{
this.radGridView1.AllowSearchRow = !this.radGridView1.AllowSearchRow;
}
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
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
here ist my "toggle button" code (in this case its a radMenuItem but its not relevant whats trigger that code)
this.radGridView1.AllowSearchRow = !this.radGridView1.AllowSearchRow;