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

One to many programmatically shows "table" in tabs rather than e.g. "Folders"

2 Answers 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 15 Jun 2010, 02:48 PM
Hello,

I've been using the winforms GridView within the same project fairly successfully until I have had attempted disiplaying a one to many relation programmatically.

It all seems to work except from that the tabs that appear underneath the master row are all labled "table".

My code is as follows :

            // folder details child view and relation 
            GridViewTemplate foldersTemplate = new GridViewTemplate(); 
            foldersTemplate.EnableGrouping = false
            foldersTemplate.AllowAddNewRow = false
            foldersTemplate.ShowColumnHeaders = false
            foldersTemplate.Columns.Add(new GridViewDataColumn(FDScheduleIdField) { IsVisible = false }); 
            foldersTemplate.Columns.Add(new GridViewDataColumn(FDFolderNameField) { Width = 400 }); 
            foldersTemplate.DataSource = _folders; 
            radGridView1.MasterGridViewTemplate.ChildGridViewTemplates.Add(foldersTemplate); 
 
            GridViewRelation foldersRelation = new GridViewRelation(radGridView1.MasterGridViewTemplate); 
            foldersRelation.ChildTemplate = foldersTemplate; 
            foldersRelation.RelationName = "upload_folders"
            foldersRelation.ParentColumnNames.Add(CUCompletedUploadIdField); 
            foldersRelation.ChildColumnNames.Add(FDScheduleIdField); 
            radGridView1.Relations.Add(foldersRelation); 
 
            // add logs child view and relation 
            GridViewTemplate logsTemplate = new GridViewTemplate(); 
            logsTemplate.EnableGrouping = false
            logsTemplate.AllowAddNewRow = false
            logsTemplate.ShowColumnHeaders = false
            logsTemplate.Columns.Add(new GridViewDataColumn(ULIdField) { IsVisible = false }); 
            logsTemplate.Columns.Add(new GridViewDataColumn(ULNameField) { Width = 400 }); 
            logsTemplate.DataSource = _logs; 
            radGridView1.MasterGridViewTemplate.ChildGridViewTemplates.Add(logsTemplate); 
 
            GridViewRelation logsRelation = new GridViewRelation(radGridView1.MasterGridViewTemplate); 
            logsRelation.ChildTemplate = logsTemplate; 
            logsRelation.RelationName = "upload_logs"
            logsRelation.ParentColumnNames.Add(CUCompletedUploadIdField); 
            logsRelation.ChildColumnNames.Add(ULIdField); 
            radGridView1.Relations.Add(logsRelation); 

But as I say the text in the tabs that appear under the master row both say "table".

How to I change this text so that it says either "Folders" or "Logs"?

Thanks

2 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 17 Jun 2010, 03:58 PM
Hello Nick Graham,

You can set the Caption to your GridViewTemplate:

foldersTemplate.Caption = "Folders";

Hope it helps.

Kind regards,
Alexander
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
Mike
Top achievements
Rank 1
answered on 17 Jun 2010, 04:37 PM
Thanks that worked.
Tags
GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Mike
Top achievements
Rank 1
Share this question
or