Query on nested list

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>




1 Reply

RN Rahul Narayanasamy Syncfusion Team May 19, 2021 02:25 PM UTC

Hi Andrew, 

Greetings from Syncfusion. 

Query: Query on nested list 

We have validated your query with the provided information(class definition) and you want to perform DataOperations in a column with one to many relationship data in Grid column. Currently we don’t have support for this feature. Already, we have already considered to implement this feature “Provide data operation for one to many relationship columns” request, and added this to our feature request list. Based on specific parameters including product vision and technological feasibility we will implement this feature. This will be available in any of our upcoming releases.     
  
You can also communicate with us regarding the open features any time using our above Feature Report page or reopen the incident. 
 
Regards, 
Rahul 


Loader.
Up arrow icon