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

[Solved] RadGridView Column Header Name

2 Answers 141 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gagan Jaswal
Top achievements
Rank 1
Gagan Jaswal asked on 18 Aug 2010, 02:20 PM
I have a datagrid that gets a resultset from a WCF Service. Before this scenario I was using domain services and the following code in my model would work to set the column headers for the grid:

[

 

Display(Name = "Class ID")]

 

 

 

 

public int ClassID { get; set; }

 

 

 

 

 

( Using System.ComponentModel.DataAnnotations

Apparently this won't work with WCF Services. Is there any other way for me to set custom Column headers for my grid, preferably in the model class library itself?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Yavor Georgiev
Telerik team
answered on 20 Aug 2010, 09:51 AM
Hi Gagan Jaswal,

 The easiest way would be to handle the AutoGeneratingColumn event of RadGridView and set the column header from there. However, if you wish to do this in your model, you need to extract your business entities in a separate library and reference it both from your SL app and web service. That way the attribute metadata will be preserved. You can find more information on the subject here and here.

Best wishes,
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Gagan Jaswal
Top achievements
Rank 1
answered on 20 Aug 2010, 01:24 PM
Thanks for your help, I'm all set now.
Tags
GridView
Asked by
Gagan Jaswal
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Gagan Jaswal
Top achievements
Rank 1
Share this question
or