Problem with create Dialog size

If I create the window dialog from the selection method in the grit it doesn't work if I change the window size. However, if I use it from a button the size works perfectly. Please, could you tell me if I am doing something wrong but I do not believe this because it was generated by your code generator.

This code dosn't work
protected async System.Threading.Tasks.Task Grid0RowSelect(Agrosystem.Models.Localhost.Device args)
{
DialogService.Open($"Order 1",
new Dictionary<string, object>() { { "OrderID", 1 } },
new DialogOptions() { Width = "700px", Height = "530px", Left = "calc(50% - 350px)", Top = "calc(50% - 265px)" });
await InvokeAsync(() => { StateHasChanged(); });
}

This code work
<RadzenButton Text=@($"Show OrderID: 1 details") Click="@(args => dialogService.Open($"Order 1",
new Dictionary<string, object>() { { "OrderID", 1} },
new DialogOptions(){ Width = "800px", Height = "530px", Left = "calc(50% - 350px)", Top = "calc(50% - 265px)" }))" />

Greetings in advance and thank you

Hi @Sergio_F,

The code you are showing seems to be from an older Radzen version. Here is what Radzen generates with default settings:

var result = await DialogService.OpenAsync<EditOrder>("Edit Order", new Dictionary<string, object>() { {"Order_ID", args.Order_ID} });
await InvokeAsync(() => { StateHasChanged(); });

And here is when Width and Height are set:

var result = await DialogService.OpenAsync<EditOrder>("Edit Order", new Dictionary<string, object>() { {"Order_ID", args.Order_ID} }, new DialogOptions(){ Width = $"{800}px",Height = $"{600}px" });
await InvokeAsync(() => { StateHasChanged(); });