Predefined Dialogue Null reference error

1 Answer 17 Views
Dialog Grid
Satish
Top achievements
Rank 1
Iron
Iron
Satish asked on 20 Aug 2025, 09:14 PM

When I call "Dialogs.AlertAsync", I get null reference error. Any reason why?  The whole page is under TelerikRootComponent.


<TelerikGrid Data="@availableSchedules" class="myTelerik-grid" SelectionMode="GridSelectionMode.Multiple"
             SelectedItems="@selectedSchedules"
             SelectedItemsChanged="@((IEnumerable<BTWInstructorAvailability> newSelected) => OnRowSelect(newSelected))"
             ScrollMode="GridScrollMode.Scrollable" Height="300px">
    <GridColumns>
        <GridCheckboxColumn CheckBoxOnlySelection="true" SelectAll="false" />
        <GridColumn Field="InstructorName" Title="Instructor Name" />
        <GridColumn Field="StartDate" DisplayFormat="{0:MM/dd/yyyy}" Title="Start Date" />
        <GridColumn Field="EndDate" DisplayFormat="{0:MM/dd/yyyy}" Title="End Date" />
        <GridColumn Field="Languages" Title="Languages" />
    </GridColumns>
</TelerikGrid>


protected async Task OnRowSelect(IEnumerable<BTWInstructorAvailability> newSelected)
{
    // Enforce max selection of 3
    if (newSelected.Count() > 3)
    {
        await Dialogs.AlertAsync("Maximum of 3 lessons can be selected.");
        return; 
    }

    selectedSchedules = newSelected;
}

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 21 Aug 2025, 04:50 AM

Hi Satish,

Please review this KB article: Telerik DialogFactory is null

If it doesn't help and the problem persists, please send a small isolated runnable app for inspection.

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Satish
Top achievements
Rank 1
Iron
Iron
commented on 21 Aug 2025, 01:49 PM | edited

Hi Dimo,

My need is to call the DialogFactory from the same Razor file Using TelerikRootComponent with Per Page/Component Interactivity.  But I see the following.  It says workaround exists, but basically it is chacking for the null, and if not showing the dialog.

https://www.telerik.com/blazor-ui/documentation/components/rootcomponent/per-component-interactivity-location

 

Dimo
Telerik team
commented on 22 Aug 2025, 06:44 AM

@Satish

To use the DialogFactory in the same .razor file, which includes the TelerikRootComponent, you need a helper child .razor component. See these two files and specifically how TelerikDialogHelper is used:

Tags
Dialog Grid
Asked by
Satish
Top achievements
Rank 1
Iron
Iron
Answers by
Dimo
Telerik team
Share this question
or