adding custom component inside a blazor dialog

     Hi, 

I am trying to add a component that I have created which I need to display in a dialog, I have tried

<SfDialog CssClass="col-sm-6" ShowCloseIcon="true" IsModal="true" @bind-Visible="@isVisible">
    <DialogTemplates>
        <Header> Edit Task</Header>
        <Content>
            <div class="container">
                    <MyComponent />
             </div>
        </Content>
    </DialogTemplates>
    <DialogButtons>
        <DialogButton Content="OK" CssClass="e-success" IsPrimary="true" OnClick="@CloseDialog" />
        <DialogButton Content="Cancel" OnClick="@CloseDialog" />
    </DialogButtons>
</SfDialog>


but when I run it, it shows the dialog as norm but the component is not rendered, does anyone have any pointers?

Thanks
Simon

1 Reply 1 reply marked as answer

RK Revanth Krishnan Syncfusion Team March 4, 2021 05:37 AM UTC

Hi Simon, 
 
 
Greetings from Syncfusion support. 
 
 
We have validated your query “Adding custom component inside a blazor dialog doesn’t render the custom component inside dialog content”. 
 
We tried to reproduce the issue in the following ways, 
  • Used the code snippet shared to render the dialog with a custom component.
  • Rendered Syncfusion Textbox inside the ‘MyComponent’ to be rendered inside the dialog.
 
But we couldn’t reproduce the issue from our end. 
 
We have prepared a sample for your reference, 
 
Can you please share us with the following details, 
  • The code snippet of the rendered component inside the dialog.
  • The Syncfusion package version used in the application
  • If possible please share us with the reproducible sample or please modify the shared sample with the issue reproducing code.
 
The above details will be helpful for us to validate and reproduce the issue from our and assist you at the earliest. 
 
Regards, 
Revanth 


Marked as answer
Loader.
Up arrow icon