Gridview showing Navigation Properties after rename of Header

4 posts, 0 answers
  1. Niklas
    Niklas avatar
    8 posts
    Member since:
    Sep 2014

    Posted 22 Jan 2015 Link to this post

    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?
  2. Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 24 Jan 2015 Link to this post

    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.

     
  3. Niklas
    Niklas avatar
    8 posts
    Member since:
    Sep 2014

    Posted 26 Jan 2015 in reply to Stefan Link to this post

    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. :)
  4. Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 27 Jan 2015 Link to this post

    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.

     
Back to Top