Hello,
I am using a SfDialog in a Component. Inside the Content of SfDialog is another Componen
1) VolumeStationErrorCodesList..-> This is a Grid ..On the header of this grid are checkboxes.. I want to pass the values selected in this Grid to DialogButton Export defined in the SfDialog
<SfDialog Width="1100px" Height="700px" ShowCloseIcon="true" @bind-Visible="WindowVisible" AllowPrerender=true IsModal=true>
<DialogTemplates>
<Header>@Title</Header>
<Content>
<div class="content-bordered">
<VolumeStationErrorCodesList @ref="VolumeStationErrorCodesList" Job_Id=@Convert.ToInt32(JobId) Data_Type=2 StationId = "@Station_Id"></VolumeStationErrorCodesList>
</div>
</Content>
</DialogTemplates>
<DialogButtons>
<DialogButton Content="Export" IsPrimary="true" OnClick="@ExportClick" />
<DialogButton Content="Close" CssClass="e-danger tmas-btn-danger" IconCss="e-icons e-close" OnClick="@SummaryReportCloseClick" />
</DialogButtons>
</SfDialog>
Question is , how do I pass value of the checkboxes defined in the grid in the component (VolumeStationErrorCodesList) out side to the Dialog Button Export OnClick @ExportClic
Please see Screen shot.
Thanks
Kapil
Hi Kapil,
Greetings from Syncfusion support.
We would like to inform in DataGrid we have inbuilt method which returns list of SelectedRecords. You can use this method to get the selected records details. Kindly check the below attached sample and code snippet for your reference.
<SfButton @onclick="click">GetSelectedRecords</SfButton>
<SfGrid DataSource="@Orders" AllowGrouping="true" AllowResizing="true" AllowSorting="true" @ref="Grid" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" Height="315"> <GridColumns> ... </GridColumns> </SfGrid>
@code { public List<Order> Orders { get; set; } public SfGrid<Order> Grid { get; set; } public async Task click() { var a = await Grid.GetSelectedRecordsAsync(); } |
Please let us know if you have any concerns.
Regards,
Monisha
This is not what I am looking for .
Please see screen shot. In the screen you will see that the header has checkboxes. I want to only export those rows which are checked.
Please review my first post
1) VolumeStationErrorCodesList..-> This is a Grid ..On the header of this grid are checkboxes.. I want to pass the values selected in this Grid to DialogButton Export defined in the SfDialog
You solution does not say anything about the checkbox
Thanks
Kapil
Thanks
for the update,
We understand that you are trying to pass the values selected in a Grid to a
Dialog Button Export that is defined in the SfDialog. To achieve this
requirement, we recommend using the GetSelectedRecordsAsync() method.
This method returns a list of selected records based on the checkbox selection
in the Grid. This should help you to pass the selected values to the Dialog
Button Export. If you continue to face any difficulties, please feel free to
share a simple issue reproducible sample and provide more details about your
exact requirement.