We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Grid search returning rows without matches.

Thread ID:

Created:

Updated:

Platform:

Replies:

127438 Nov 15,2016 06:15 PM Nov 16,2016 06:20 AM ASP.NET Web Forms 1
loading
Tags: Grid
Patrick Kilgore
Asked On November 15, 2016 06:15 PM

I have a data grid that is matching on fields that I'm not displaying in the grid results.
For example If I have the below class and grid, could I have the search ignore ImageURL?
public class SlideKit{
public string Title { get; set; }
public int Id { get; set; }
public string ImageURL { get; set; }
}
and I the grid:
@(Html.EJ().Grid("pifPresentationSearchResults")
.Datasource((IEnumerable)Model.SlidekitList)
.ToolbarSettings(toolbar => { toolbar.ShowToolbar().ToolbarItems(items => { items.AddTool(ToolBarItems.Search); }); })
.AllowScrolling()
.AllowSelection(false)
.ScrollSettings(scroll => { scroll.Height(380); })
.RowTemplate("#templateData")
.Columns(col =>
{
col.HeaderText("").Width("25px").Add();
col.HeaderText("PRESENTATION DETAILS").Add();
})
)

Venkatesh Ayothi Raman [Syncfusion]
Replied On November 16, 2016 06:20 AM

Hi Patrick, 

Thanks for contacting Syncfusion support. 

Normally search operation perform the searching in Grid based on the given data source. If we give only 4 fields for presentation details and performing the search operation in Grid, then it searches the whole data source and returned matches rows in all fields instead of given 4 fields.  
So the input value has should be in result of the matched rows in any other fields. We can check the result the data after searching by call the getCurrentViewData() method in console window. We suspect this is cause of the issue and suggest you to use refer to the following code example for resolve this issue, 
Code example
@(Html.EJ().Grid<EmployeeView>("RowTemplate") 
        .Datasource((IEnumerable<object>)ViewBag.datasource) 
        .AllowScrolling() 
        .ScrollSettings(scroll => { scroll.Height(380).Width(500); }) 
        .ToolbarSettings(toolbar => { toolbar.ShowToolbar().ToolbarItems(items => { items.AddTool(ToolBarItems.Search); }); }) 
        .RowTemplate("#templateData") 
        .ClientSideEvents(e=>e.ActionBegin("ActionBegin").ActionComplete("ActionComplete")) 
        .Columns(col => 
        { 
           . . . 
        }) 
    ) 
 
<script> 
 
     
    function ActionBegin(args) { 
        if (args.requestType == "searching") 
            this.model.searchSettings.fields = ["LastName", "FirstName", "Title"]; // here we can search the Grid with given fields. So it will returned the results only matched items. 
    } 
</script> 

We have also created a sample for your convenience which can be download from following link, 
If you still face the same issue, then could you please provide following details? 
1)      Essential studio version details 
2)      Issue replication procedure. 
3)      Screenshot of Grid with search input. 
4)      Screenshot of search results. 
5)      A sample if possible or modify the given sample as issue reproducible. 

Regards, 
Venkatesh Ayothiraman. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;