The problem is that I can't give the route for edit page;
The route is : "/developer/edit/{developerId:int}"
When I click on edit the page Edit must be open!
Have you an idea?
Thanks in advance
<Template Context="developers">
<RadzenButton Icon="edit" Size="ButtonSize.Small" Click="@(args => EditDeveloper(developers.Id))" @onclick:stopPropagation="true"> </RadzenButton> </Template> @code{ [Parameter] public int EditId { get; set; } Developer dev = new Developer(); protected async override Task OnParametersSetAsync() {
dev = await http.GetFromJsonAsync($"api/developer/@dev.Id");
}
async Task EditDeveloper(int EditId)
{
await http.PutAsJsonAsync("api/developer", dev);
await js.InvokeVoidAsync("alert", $"Updated Successfully!");
}
}
I've obtained the error message : An unhandled error has occurred. Reload
I didn't see the icon edit I only see delete icon. I've used the linked https://blazor.radzen.com/datagrid-inline-edit. In my side I don't want to modify the ligne but I want to open a page Edit. I don't know if I can do that with radzen. When I used a simple tab with href="developer/edit/@dev.Id" all things is OK!
I don't understand what you are trying to achieve. You mention inline editing but then want to open a separate page when the edit button is clicked (which isn't inline editing). To open a different page you can use the NavigationManager:
Hi, thanks to your answer.
sorry I've did a mistake in subject.
FYI, I begin with visual studio and blazor radzen also. I use blazor because I've lot used rshiny that is same tbat blazor WASM.
I will check your proposition a d I will come back.
What tab are you referring to? I thought you were using the RadzenDataGrid. If you use the code I've shared clicking a button will navigate to the specified route.
Thanks to your reply.
I will check it. So If I understand @inject NavigationManager uriHelper is not good. Can you tell me how I can do that?
thanks in advance
So I've changeg as you propose. I don't have any more problem in code.
When I launched the app I don't see the edit button in datagrid I only see the delete button.
This means that the route is not good.
However, I have to go to the page : @page "/developer/edit/{developerId:int}" where to find the <FormEdit buttonText ButtonText="Update" dev="dev" OnValidSubmit="@EditDeveloper" >
The route shouldn't cause the column not to be visible. You can try removing the other columns to see if it makes a difference. Also you can paste here the complete RadzenDataGrid declaration. Maybe there is something obvious.