How to display and edit relational data in a grid

I have an application in which some of the data is relational, and I'd like to display it in a grid and allow editing there. The alternative is to separate the relational data and require the user to edit it in a separate place.

I've looked at the SfTreeGrid, but I don't think I need that. It appears to put data that references itself to be displayed in a tree view, but that's not the case that I have.

The main data in the grid I want to display differs in shape from the sub-data it contains. For example, this is similar to what I have in mind:

First name, Last name, age
              Book name, Checkout Date

The main grid would display a list of persons, and each person might have a list of books to display. All of the data on display should be editable.

Would any of the SF controls work as I have described? If so, which?

Thanks!

Gil


3 Replies 1 reply marked as answer

DD Dhivyabharathi Dakshinamurthy Syncfusion Team April 1, 2024 03:59 PM UTC

Hi Gil Yoder,

  • We can achieve the desired functionality using the SfDataGrid control, which is suitable for displaying and editing relational data.
  • The SfDataGrid provides support for representing additional information of a row using TemplateViewDefinition.
  • This allows you to define a RowTemplate containing any WPF controls to display additional information.
  • You can expand or collapse the RowTemplate view using an expander in a row or programmatically.

    Kindly refer the following UG link:
    Record Template View in WPF DataGrid control | Syncfusion

    We hope this helps you with your requirement. Please feel free to share any concerns you may have.



Marked as answer

GY Gil Yoder April 1, 2024 09:24 PM UTC

Excellent! This appears to be just what I need.



VS Vijayarasan Sivanandham Syncfusion Team April 2, 2024 06:42 AM UTC

Gil Yoder,

We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.


Loader.
Up arrow icon