The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I'm using an SfDataGrid control to display some data coming from an ObservableCollection. Columns are getting autogenerated and named based on the properties of the model (i.e. first name, last name, phone). Can I change the name displayed in the column header without changing the name of the underlying model property? For example if the property in the model is called FirstName can I add a decorator/attribute to let the control know the column name must be First Name?
KKKarthikraja Kalaimani Syncfusion Team May 12, 2023 09:19 AM UTC
Hi Nicholas,
Yes, you can change the column header text without changing the name of the underlying model property in the SfDataGrid. You can use the AutoGeneratingColumn event of the SfDataGrid control to customize the column header text based on your requirements. Please refer to the following code snippets.
KKKarthikraja Kalaimani Syncfusion Team May 15, 2023 10:19 AM UTC
We have the ability to customize the header text for any property type bound to the ItemsSource property of the SfDataGrid during the AutoGeneratingColumn event. This event allows us to modify the column header text based on our specific requirements. By handling this event, we can dynamically set the header text for each column based on the mapping name being displayed in the grid.
Need More Help?
Get personalized assistance from our support team.