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

Binding a Navigation Property in Column on DataGrid

I am trying to bind a property from a navigation property on my data grid. I have a customer class where one of the properties is CustomerBalance...

public ICollection<CustomerBalance> CustomerBalance { get; set; }

One of the properties in the customer balance class is CurrentBalance...

public decimal CurrentBalance

        {

            get => GetPropertyValue<decimal>();

            set => SetPropertyValue(value);

        }

I have tried the following, which doesn't work...

<GridColumn Field=@nameof(CustomerBalance.CurrentBalance) HeaderText="Balance"></GridColumn>

Please advise.


3 Replies 1 reply marked as answer

PS Prathap Senthil Syncfusion Team March 29, 2023 02:11 PM UTC

Hi Clay,

We validated the query, but we are still unable to reproduce the reported issue in our final version[21.1.35].Before proceeding further with your requirement. kindly share the below details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.

  1. Kindly share the grid code snippet with the model class
  2. Share with us the NuGet version used.
  3. please share a simple issue reproducible sample.
  4. If possible, please share your try to replicate the previously provided sample.

Regards,

Prathap S


Attachment: BlazorDataGrid_(2)_fe881747.zip


CH Clay Hess March 29, 2023 06:30 PM UTC

I fixed it by using a template in the column.


Marked as answer

PS Prathap Senthil Syncfusion Team March 30, 2023 08:58 AM UTC

Thanks for the update,

We are happy to hear that the issue has been resolved on your end. If you have any further questions, please do not hesitate to reach out to us.


Loader.
Up arrow icon