Issue with Real-Time UI Updates in Grid Edit Settings Dialog Template
I am facing an issue with real-time UI updates during grid editing in the Edit Settings dialog. When I click "Add" or "Edit," the dialog box opens, and there is a flag that determines whether a textbox is displayed. If the flag is set to true, the textbox should appear. However, in my case, the textbox only appears after clicking the "Save" button, rather than updating in real time. The StateHasChanged method does not seem to resolve this issue.
Hi sami khan,
Greetings from Syncfusion,
Based on your issue, we would like to let you know that we have optimized the
Grid component's rendering during external actions to enhance performance.
Therefore, we recommend using the grid's public method PreventRender(false)
in the onchange event to update the UI real time and achieve your desired
result. Please refer to the attached code snippet for further reference.
|
<div class="form-group col-md-6"> <SfCheckBox @bind-Checked="isChecked" Label="Change" @onchange="onChange"></SfCheckBox> </div> @if (flag == true) { <div class="form-group col-md-6"> <SfTextBox ID="CustomerID" @bind-Value="@(Order.CustomerID)" TValue="string" FloatLabelType="FloatLabelType.Always" Placeholder="Customer Name"> </SfTextBox> </div> }
</div> private async Task onChange(Microsoft.AspNetCore.Components.ChangeEventArgs args) { string check = args.Value.ToString(); if (check == "True") { flag = true; } else { flag = false; } Grid.PreventRender(false); }
|
Sample:
https://blazorplayground.syncfusion.com/embed/BtLoXCBUAhdzqddy?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5
Regards,
Naveen
Thank you, Naveen Palanivel, for your response. I have managed to control this with another logic, but I have also tested your provided solution, and it works as well. Thank you so much for your help and response.
Thanks for the update. We are happy to hear that the provided information was helpful.
Please get back to us if you face any issues with the provided solution.
- 3 Replies
- 3 Participants
- Marked answer
-
SK sami khan
- Jan 21, 2025 05:41 PM UTC
- Jan 24, 2025 01:51 PM UTC