BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
I have a control as below
<SfDialog @ref="@UserDialogObj" Visible="false" AllowDragging="true" EnableResize="true" ShowCloseIcon="true" Width="960px" Height="480px">
<DialogTemplates>
<Header>
User Details
</Header>
<Content>
<Control_User @ref="@controlUserObj"></Control_User>
</Content>
</DialogTemplates>
</SfDialog>
If i load the page as above, the control
controlUserObj is null and cannot access any properties. If Visible=true , then
controlUserObj is accessible.
What's the best practice to show hide Dialog with a child control?
<SfDialog @ref="DialogObj" Width="450px" ShowCloseIcon="true" Visible=false> <DialogEvents Opened="@DialogOpen"></DialogEvents> <DialogTemplates> <Header> <div>Dialog Header</div> </Header> <Content> <CustomComponent @ref="rteObj"></CustomComponent> </Content> </DialogTemplates> </SfDialog>@code { SfDialog DialogObj; SfRichTextEditor RteObj; CustomComponent rteObj; private void OpenDialog() { this.DialogObj.ShowAsync(); } private void DialogOpen() { rteObj.refreshUI(); } } |
It appears removing the @ in the @ref property helped :) thank you
<SfDialog @ref="UserDialogObj" Visible="false" AllowDragging="true" EnableResize="true" ShowCloseIcon="true" Width="960px" Height="480px">
<DialogTemplates>
<Header>
User Details
</Header>
<Content>
<Control_User @ref="controlUserObj"></Control_User>
</Content>
</DialogTemplates>
</SfDialog>
Hi Anthony,