Hi,
I would like to make some sort of validations before allow user to change current tab with the selected new one.
I have defined my tabs as follow:
<RadzenTabs TabPosition="TabPosition.Top" RenderMode="TabRenderMode.Server" Change="@(async args => { await OnTabChange(args); })" SelectedIndex="selectedIndex">
<Tabs>
<RadzenTabsItem Text="MainDataTab">
</RadzenTabsItem>
<RadzenTabsItem Text="SecondaryTab">
</RadzenTabsItem>
</Tabs>
</RadzenTabs>
and in the code behind I have the following method:
private async Task OnTabChange(int index)
{
var confirmResult = await DialogService.Confirm("Sure?", "Warning", new ConfirmOptions() { OkButtonText = "Yes", CancelButtonText = "No" });
if (confirmResult.HasValue && confirmResult.Value)
{
selectedIndex = index;
}
DialogService.Close(true);
DialogService.Dispose();
}
But the control renders the new tab before I make my dialog popup choice.
How I have to do?
Thank you very much