Grid DetailTemplate - source cannot be null when showing 2 details

Hi,

I get an error when I display more than one detail at the same time. If I close the detail before opening another I don't have the problem.

Unhandled exception rendering component: Value cannot be null. (Parameter 'source')

<GridTemplates>
    <DetailTemplate Context="FinAccountContext">
        @{
            var finWritingGrouped = FinAccountContext as GetFinWritingsGroupedResponse;
            var QueryDetail = new Query()
                .Where("FinAccountId", "equal", finWritingGrouped.FinAccountId)
                .Where("FinancialYearId", "equal", currentFinancialYearId)
                .Sort("DueDate", null);
            <SfGrid ID="FinWritingsByFinAccountGrid" TValue="GetFinWritingsByAccountIdResponse"
                    AllowPaging="true" AllowResizing="true" AllowSorting="false" AllowFiltering="false"
                    Query="@QueryDetail">
                <SfDataManager Url="/odata/finwritings/" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager>
                <GridEvents CommandClicked="OnCommandClicked" TValue="GetFinWritingsByAccountIdResponse"></GridEvents>
                <GridPageSettings PageSize="5" PageSizes="5"></GridPageSettings>
                <GridColumns>
                    <GridColumn Field=@nameof(GetFinWritingsByAccountIdResponse.Description)
                                TextAlign="TextAlign.Left">
                    </GridColumn>
                    <GridColumn Field=@nameof(GetFinWritingsByAccountIdResponse.DueDate)
                                TextAlign="TextAlign.Center" Format="d" Type="ColumnType.Date">
                    </GridColumn>
                    <GridColumn Field=@nameof(GetFinWritingsByAccountIdResponse.UnCleared)
                                TextAlign="TextAlign.Right" Format="N2">
                    </GridColumn>
                    <GridColumn Width="100px">
                        <GridCommandColumns>
                            <GridCommandColumn ButtonOption="@(new CommandButtonOptions() {
                        Content = "+" })">
                            </GridCommandColumn>
                        </GridCommandColumns>
                    </GridColumn>
                </GridColumns>
            </SfGrid>
        }
    </DetailTemplate>
</GridTemplates>

3 Replies

NP Naveen Palanivel Syncfusion Team December 4, 2023 08:27 PM UTC

Hi Hermans,

Based on your code snippet, we prepared simple sample at our end. However, we were unable to replicate the reported problem on our end. Please find the attached sample for your reference


Sample : https://blazorplayground.syncfusion.com/embed/rZBAiLNpGAHXCZvH?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5

If the reported issue still reproduced then kindly share the below details to validate further at our end.


  1. Share us the entire Grid code snippet along with model class
  2. Please share if we missed any replication procedure in attached sample
  3. Share a video demonstration of the issue with a detailed explanation. This will greatly assist us in understanding the problem.
  4. Please provide a simple sample that reproduces the issue with duplicate data or try to modify the above mentioned sample.


The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.


Regards,

Naveen Palanivel



JH Jean-François Hermans December 7, 2023 03:46 PM UTC

The problem occurs when I mistakenly enter the following

Image_3567_1701963861773

Correction: PageSizes="@(new string[] { "5", "10" })"

Sorry to have opened a ticket for these stupid mistake :/



NP Naveen Palanivel Syncfusion Team December 11, 2023 11:13 AM UTC

Hi Jean-Francois Hermans,


We are glad to hear that you have resolved your query on your own.


Please get back to us if you need further assistance.


Regards,

Naveen Palanivel.


Loader.
Up arrow icon