This is a migrated thread and some comments may be shown as answers.

ColumnGroups: How to change the name of the column after data loaded

2 Answers 2022 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Moriz
Top achievements
Rank 2
Moriz asked on 16 Jan 2019, 08:03 PM

Hi,

I have installed 2019.1.115.40 trial and I am testing RadGridView and trying to achieve require results using ColumnGroups view. From the documentation I have achieved the following.

 

ColumnGroupsViewDefinition view = new ColumnGroupsViewDefinition();

view.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());
view.ColumnGroups[0].Rows[0].ColumnNames.Add("CompanyID");

 

I have learnt that the "CompanyID" should be same as of the Column-Heading of the data-table (data-source) provided to the grid.

My question is: Is it possible if I can change this "CompanyID" text after data has been loaded into the grid.

Or is there anything I can do, as with the datagridview, we use Name property for binding and Text property for display purpose.

Attached image might help.

Thanks

 

Regards,

2 Answers, 1 is accepted

Sort by
0
Moriz
Top achievements
Rank 2
answered on 17 Jan 2019, 03:05 PM

Thought I should share the solution of the above problem for visitors.

Following is the help I received from the Support and it worked perfectly.

"You can leave the default column name which contains the date and hour and only change the HeaderText. For example:"
 

radGridView1.Columns["YourColumnName"].HeaderText = "Your Column's Display Text";

 

Attached image is of the required result.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Jan 2019, 10:01 AM
Hello, Moriz,        

I am glad that the problem you were facing is now resolved. Indeed, the HeaderText property of the columns specifies what text exactly will be displayed in the column's header. You can refer to the Columns section in the online documentation for any further information regarding the grid columns: https://docs.telerik.com/devtools/winforms/controls/gridview/columns/gridviewcolumn

 If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Moriz
Top achievements
Rank 2
Answers by
Moriz
Top achievements
Rank 2
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or