Hi,
I'm trying to work out how to create a query based on a List that's in the main class for a Grid. I have a class Process that contains a List<ProcessSection>. I would like to use Query in a Grid to select only those in the data source Processes that has a SectionName matching the value sent to GetProcessBySection. The contains works fine when its just a string, but I'm not sure how to use it with a class list.
public class Process
{
public int ProcessId { get; set; }
public string Reference { get; set; }
public List<ProcessSection> ProcessSections { get; set; }
}
public class ProcessSection
{
public int SectionId { get; set; }
public string SectionName { get; set; }
}
private Query GetProcessBySection(string value)
{
return new Query().Where("ProcessSection", "contains", value);
}
<SfGrid DataSource="@Processes" Query="@GetProcessItems(s)">
<GridColumns>
<GridColumn Visible="false" AutoFit="true" Field="@nameof(Process.ProcessId)" HeaderText="Job Id" IsPrimaryKey="true"></GridColumn>
<GridColumn AutoFit="false" Field="@nameof(Process.Reference)" HeaderText="Process" Visible="true"></GridColumn>
</GridColumns>
</SfGrid>