I have the following (simplified) VMs;
public class ProjectModel
{
public int ProjectId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public List<CountryModel> Countries { get; set; }
}
public class CountryModel
{
public int CountryId { get; set; }
public string Name { get; set; }
}
I am using the Grid with ajax binding to display the list of projects. I have a custom UI for the user to specify search criteria, i.e. textboxes for name and description, and a MultiSelect control so that the user can select one or more countries.
I want custom filtering against the countries - I want the search to perform an AND filter returning Projects that are associated with all the countries selected by the user.
I am currently able to capture title, description and the selected countries from the MultiSelect, and pass them to my ProjectSearch Controller Action as additional data (using the DataSource Read Data). I then create FilterDescriptors for the project name and description, but am a bit stuck as to how to do it for the countries.
So what is the correct way of creating the FilterDescriptors for a country search? What "member" should I specify? What operator do I use?
Many thanks for any assistance.
Phil
public class ProjectModel
{
public int ProjectId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public List<CountryModel> Countries { get; set; }
}
public class CountryModel
{
public int CountryId { get; set; }
public string Name { get; set; }
}
I am using the Grid with ajax binding to display the list of projects. I have a custom UI for the user to specify search criteria, i.e. textboxes for name and description, and a MultiSelect control so that the user can select one or more countries.
I want custom filtering against the countries - I want the search to perform an AND filter returning Projects that are associated with all the countries selected by the user.
I am currently able to capture title, description and the selected countries from the MultiSelect, and pass them to my ProjectSearch Controller Action as additional data (using the DataSource Read Data). I then create FilterDescriptors for the project name and description, but am a bit stuck as to how to do it for the countries.
So what is the correct way of creating the FilterDescriptors for a country search? What "member" should I specify? What operator do I use?
Many thanks for any assistance.
Phil