You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, In blazor application. On one page I have grid and edit form. I have bind that form with EditContext. Everything is woring great. The only concern is when I am clicking the grid row and updating the context, the edit form is flickering. Here is sample code.
you can think these anchor tags as grid rows.
SfTooltip tooltipObj;
SfTooltip tooltipObj2;
private Test model;
private EditContext editContext;
private string temp { get; set; }
private double tipx { get; set; }
private double tipy { get; set; }
private string cssClass { get; set; }
protected override void OnInitialized()
{
model = new Test();
editContext = new EditContext(model);
tipx = -99999;
tipy = -99999;
}
protected void B1Click()
{
model = new Test() { TestProperty = "Hello" };
editContext = new EditContext(model);
}
protected void B2Click()
{
model = new Test() { TestProperty = "Hello Test" };
editContext = new EditContext(model);
}
public class Test
{
[Required]
public string TestProperty { get; set; }
[Required]
public string TestProperty1 { get; set; }
}
public void TestPropertyBlurEvent(FocusOutEventArgs args)
{
if (!editContext.Validate())
{
//tooltipObj.Open();
cssClass = "e-error";
tipx = default(double);
tipy = default(double);
}
else
{
//tooltipObj.Close();
cssClass = "e-success";
tipx = -99999;
tipy = -99999;
}
}
}
`
Everywhere I seen the example bind with model not with editcontext, can anybody please help to stop this flickering. If I am removing this code editContext = new EditContext(model); then its working fine but then I am not able to see the validation messages.
Attaching the sample application. BlazorApp3 (2).zip
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, In blazor application. On one page I have grid and edit form. I have bind that form with EditContext. Everything is woring great. The only concern is when I am clicking the grid row and updating the context, the edit form is flickering. Here is sample code.
you can think these anchor tags as grid rows.
`@code{
}
`
Everywhere I seen the example bind with model not with editcontext, can anybody please help to stop this flickering. If I am removing this code
editContext = new EditContext(model);
then its working fine but then I am not able to see the validation messages.Attaching the sample application.
BlazorApp3 (2).zip
Beta Was this translation helpful? Give feedback.
All reactions