Grid Feature Request: Add clear button to search box

When we use the search in the toolbar the user has to highlight the searched text, delete it, then click the search icon. Please add a little "x" in the seach box to permit the clearing and auto-research with no criteria.

This would be like the SfComboBox control's behavior.

Thanks for the considerations.

4 Replies

RS Renjith Singh Rajendran Syncfusion Team September 11, 2020 11:40 AM UTC

Hi Scott, 

Greetings from Syncfusion support. 

Based on your requirement, we suggest you to have a custom toolbar Clear button next to the Search field. Now when clicking the button we have cleared the search performed in Grid by calling the Search(“”) method of Grid. Please refer the below documentation for more details on custom and built in tollbar items, 

Please refer and use as like the codes below, 

 
<SfGrid @ref="Grid" ... Toolbar=@(new List<object>() { "Search"new ItemModel() { PrefixIcon="e-searchclose", TooltipText = "Clear",Align=ItemAlign.Right, Id = "Clear" }})> 
    <GridEvents OnToolbarClick="OnToolbarClick" TValue="Order"></GridEvents> 
    ... 
</SfGrid> 
 
<style> 
    .e-searchclose::before { 
        content'\e932'; 
    } 
</style> 
 
@code{ 
    public List<Order> Orders { getset; } 
    SfGrid<Order> Grid; 
    ... 
    public void OnToolbarClick(Syncfusion.Blazor.Navigations.ClickEventArgs args) 
    { 
        if(args.Item.Id == "Clear") 
        { 
            Grid.Search(""); 
        } 
    } 
} 


Please refer the below documentation for the list of available icons, 

We have also prepared a sample based on this scenario, please download the sample from the link below, 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 



SP Scott Peal September 11, 2020 01:48 PM UTC

Thanks but no thanks. That puts the close button outside the search box. Not inside it like the combo box control does. 

BTW, not looking for a work around. I am asking you to consider adding this feature to the core code. The combo box uses, why not use the same control in the grid?




MC Mike Chafin September 12, 2020 11:51 AM UTC

This should be a part of the Search textbox as Scott has suggested. 

Clicking the x should clear the search textbox and return the Grid to the search starting point.


RS Renjith Singh Rajendran Syncfusion Team September 15, 2020 11:02 AM UTC

 
We have considered this as a usability feature improvement and logged an usability feature improvement task for the same “Provide support to show Clear icon in search textbox toolbar item”. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.   
   
You can now track the current status of this feature request here.   
   
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision and technological feasibility. It will be implemented in our upcoming Volume 4, 2020 release.   
 
You can communicate with us regarding the open features any time using our above Feedback report page. 
 
Regards, 
Renjith Singh Rajendran 


Loader.
Up arrow icon