Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

RadGridView Hierarchy: Child table hiding columns in its template

$
0
0

Hello , I have programmatically generated  a radgrid with a hierarchy, see screenshot below of the result, its working well.

ReportID is the linking column,

My problem is, changes i make in the child template do not seem to have any effect, for example i am trying to hide the child ReportID and ReportName  columns in the child grids.

I have hidden the ReportID column in the Parent data grid template and that works, just battling to get the child template to apply to the child grids. 

My code snippet is below:

    dglabels.DataSource = dtsummary

        dglabels.MasterTemplate.Columns("ReportID").IsVisible = False
        dglabels.MasterTemplate.BestFitColumns()


        Dim template As New GridViewTemplate()
        template.DataSource = dtLabels

        ' this seems to have no effect:
        template.Columns("ReportID").IsVisible = False
        template.Columns("ReportName").IsVisible = False

        Dim relation As New GridViewRelation(dglabels.MasterTemplate)
        relation.ChildTemplate = template
        relation.RelationName = "ReportsStockCodes"
        relation.ParentColumnNames.Add("ReportID")
        relation.ChildColumnNames.Add("ReportID")
        dglabels.Relations.Add(relation)

        'try hide columns again, this seems to have no effect:
        relation.ChildTemplate.Columns("ReportID").IsVisible = False
        relation.ChildTemplate.Columns("ReportName").IsVisible = False


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>