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

Hierarchy Template Problem

2 Answers 55 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 08 Apr 2011, 12:10 AM
I've followed this tutorial for binding hierarchy data:

http://www.telerik.com/help/winforms/gridview-hierarchical-grid-tutorial-binding-to-hierarchical-data.html

The data is displaying properly, and the Parent level template works as it should. However, the child level template is not working at all. Whether I use the grid property builder or the template collections interface, I can not customize which columns are visible or change header names etc. It always shows every single column from the table adapter. I need to be able to use foreign keys which are invisible, not to mention renaming headers or resizing columns.

Thanks for the help.

2 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 08 Apr 2011, 09:19 AM
Hello,

Just as you can set column properties on the master template, you can also set the column properties on the child templates. So if you have a template set up called childTemplate, then you could specify
childTemplate.Columns["Name"].IsVisible = false;

You may also find this help topic on accessing and itterating columns useful.

Hope that helps but let me know if you need more information
Richard
0
Ryan
Top achievements
Rank 1
answered on 08 Apr 2011, 07:24 PM
Thanks for your help Richard!

Modifying the properties directly through code works.

I'm happy that I have my data displaying as it should. However, I wish telerik would have just built it in directly to avoid this confusion.
Tags
GridView
Asked by
Ryan
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Ryan
Top achievements
Rank 1
Share this question
or