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

Gridview showing Navigation Properties after rename of Header

3 Answers 42 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Niklas
Top achievements
Rank 1
Niklas asked on 22 Jan 2015, 01:39 PM
Im using a RadGridView to display my data. Columns are autogenerated for different datatypes. Problem occures when i try to change the Header of the columns in the AutoGeneratingColumn event.

As i add the line:
e.Column.Header = "New header name here";

The columns gets renamed, but also now all the Navigation Properties are shown as columns as well. This is nothing i want. Is this a bug or is it some way of telling if the column is a Property or a Navigation Property?

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 24 Jan 2015, 03:18 PM
Hello Niklas,

I am not entirely sure what is your exact issue. I have set up a sample project that I would appreciate if you modify it in a way that reproduces the issue and send it back to us. Could you also make an image of the behavior you consider as incorrect? Are you sure you are using the latest binaries version?

I am looking forward to your reply.

Kind Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Niklas
Top achievements
Rank 1
answered on 26 Jan 2015, 07:14 AM
I solved the issue by checking e.ItemPropertyInfo.PropertyType.IsSerializable. So i just change the name of those columns, and not the Navigation Properties.

But i still find iot strange that the Navigation Propertyes gets visible as columns as one renames the header of it.. Since it was not visible before the renaming of it. :)
0
Stefan
Telerik team
answered on 27 Jan 2015, 09:07 AM
Hello Niklas,

I am glad you have found solution for your issue. A possible reason for it might be the lazy loading of the Navigation Properties of your model. When you set their header directly you might be enforcing them as usual columns, but without the code I am not able to confirm that.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Niklas
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Niklas
Top achievements
Rank 1
Share this question
or