We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid Column does not show any data

I have a simple class, which includes another class

   public class QuoteRequest    {

        public int QuoteRequestId { get; set; }

        public DateTime DateTimeReceived { get; set; }

        public string PlatformUsed { get; set; }

        public Coupon coupon { get; set; }

        public int? CouponId { get; set; }

}

The coupon class is :

 public class Coupon

    {

        public int CouponId { get; set; }

        public string Couponnumber {get; set; }

    }


My blazor page code has this code, which populates list just fine, all the data is present


protected override async Task OnInitializedAsync()

        {

            QuoteRecordList = (await QuoteDataServices.GetQuoteData(null, null)).ToList();

        }

The grid shows all the columns, but failing on this one. It's blank. However data is present in the list.


 <GridColumn Field=@nameof(QuoteRequest.coupon.Couponnumber) TextAlign="TextAlign.Center" HeaderText="Coupon" AutoFit="true"></GridColumn>





3 Replies

NP Naveen Palanivel Syncfusion Team December 2, 2022 01:20 AM UTC

Hi Alex


Query 1 : “Grid Column does not show any data”


Based on your query, Grid Column does not show any data in complex data binding. we have already discussed about this  similar topics detailly in our UG documentation. Kindly refer the documentation link shared.


Reference : https://blazor.syncfusion.com/documentation/datagrid/columns#complex-data-binding



Please let us know if you have any concerns.


Regards,

Naveen Palanivel



AL Alex December 2, 2022 04:10 AM UTC

Thank you very much, the line below solved the issue.



<GridColumn Field="coupon.Couponnumber" TextAlign="TextAlign.Center" HeaderText="Coupon" AutoFit="true"></GridColumn>



NP Naveen Palanivel Syncfusion Team December 4, 2022 06:29 AM UTC


Welcome


We are glad to hear that your query has been resolved. 


Please get back to us if you need further assistance.



Loader.
Live Chat Icon For mobile
Up arrow icon