Hi Eugene,
Greetings from Syncfusion support.
Query 1 : - User clicks a field [A] (e.g. "Customer Name", "Ship Country", "Ship City" from the example of the URL above) - A second modal [M2] opens with a table of the related entities with all the filter/search features of a full-fledged SfGrid
We suggest you to use the OnRecordClick event of Grid. In this event handler, you can open the SfDialog(which contains a full-fledged grid) by changing the value of @bind-Visible property of SfDialog. Now when click on a row in Grid, the SfDialog will be opened with a Grid in it.
Documentation :
Please refer the code below,
<SfDialog ShowCloseIcon="true" Width="300" IsModal="true" @bind-Visible="ShowDialog">
<DialogTemplates>
<Content>
<div class="row">
<SfGrid ID="Grid" @ref="InnerGrid" DataSource="@Orders" ...>
...
</SfGrid>
</div>
<DialogButtons>
<DialogButton OnClick="@(() => SaveClick())">
<DialogButtonModel Content="Save" IsPrimary="true"></DialogButtonModel>
</DialogButton>
<DialogButton OnClick="@(() => { ShowDialog = false; })">
<DialogButtonModel Content="Cancel"></DialogButtonModel>
</DialogButton>
</DialogButtons>
</Content>
</DialogTemplates>
</SfDialog>
<SfGrid DataSource="@Orders" AllowPaging="true" AllowFiltering="true" >
<GridEvents OnRecordClick="OnRecordClick" TValue="Order"></GridEvents>
...
</SfGrid>
@code {
...
private void OnRecordClick(RecordClickEventArgs<Order> args)
{ ShowDialog = true; //show the dialog
}
}
|
Query 2 : Once the user narrowed down the large list of entities in this modal [M2], the user selects one (in case of a one-to-many) or multiple (in case of a many-to-many) rows and clicks the "ok"/"select"/"done" button in the [M2].
You can use the GetSelectedRecords method of the Grid, to fetch the selected record data when the button in the Dialog is clicked. Now you will have the selected records data of the Grid inside the Dialog component.
Please refer the code below,
SfGrid<Order> InnerGrid;...private async Task SaveClick(){ var selectedRecords = await InnerGrid.GetSelectedRecords(); //get the selected records data //now you will have the selected rows data in selectedRecords variable. You can use this data to update in the Orders List, before closing the Dialog by setting the ShowDialog to false. InnerGrid.Refresh(); //refresh the changes in inner Grid before closing dialog ShowDialog = false; //hide the dialog}
|
We are not clear about this query. As explained above, you can use the value you get from the GetSelectedRecords method to update your datasource. If you need further assistance, regarding this query, then we need more details to further proceed on this. Kindly get back to us with the following details to proceed further on this.
- Share with us the details regarding how you are using the Chips component in Grid.
- Share with us a pictorial representation(video demo explaining your requirement ) showing your requirement in Query 3.
- Share with us the codes you are using to bind Chip to Grid.
- On clicking the save, do you want to update the entire datasource of the main Grid, or just the particular chip in a cell in Grid?
- Share with us a detailed explanation regarding the structure of Grid you are using. Share the complete Grid rendering codes. And dialog codes.
We have prepared a sample based on the above explanations in Query 1, Query 2. We are attaching the sample for your convenience. Please download the sample from the link below,
Please get back to us if you need further assistance.
Regards,
Renjith Singh Rajendran