This is a migrated thread and some comments may be shown as answers.
Need help with Child filterrow
0 Answers 12 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Trey asked on 22 Oct 2012, 12:39 PM
Basically I have a parent/child layout,and I just need a filter row on the child, but I cannot seem to figure it out!

Here is what it looks like now:(it only shows the filter for my parent row)

My code that bind the parent/child:

 private void RecordstoDatGrid(ref RadGridView ParentGrid, DataSet DS)
            foreach (DataTable DT in DS.Tables)
                if (DT.TableName != "Templates")
                    GridViewTemplate tmpTemplate = new GridViewTemplate();
                    tmpTemplate.DataSource = DS;
                    tmpTemplate.DataMember = DT.TableName;
                    GridViewRelation tmpRelation = new GridViewRelation(ParentGrid.MasterTemplate);
                    ParentGrid.MasterTemplate.EnableFiltering = true;
                    ParentGrid.MasterTemplate.EnableGrouping = true;
                    ParentGrid.MasterTemplate.ShowFilteringRow = true;
                    tmpRelation.ParentTemplate = ParentGrid.MasterTemplate;
                    ParentGrid.MasterTemplate.ShowChildViewCaptions = false;
                    tmpRelation.ChildTemplate = tmpTemplate;
                    tmpRelation.RelationName = string.Format("ParentChild_{0}", DT.TableName);
                    tmpTemplate.Columns["TemplateID"].IsVisible = false;
                    tmpTemplate.AllowColumnChooser = true;
                    tmpTemplate.AllowColumnReorder = true;
                    tmpTemplate.AllowColumnResize = true;
                    tmpTemplate.AllowDragToGroup = true;
                    tmpTemplate.AllowRowReorder = true;
                    tmpTemplate.AllowRowResize = true;

                    tmpTemplate.ShowHeaderCellButtons = true;
                    tmpTemplate.EnableGrouping = true;
                    tmpTemplate.Caption = DT.TableName;
                    tmpTemplate.ShowChildViewCaptions = false;
                    ParentGrid.ChildRows[0].IsExpanded = true;
                    ParentGrid.TableElement.ShowSelfReferenceLines = true;
                    tmpTemplate.ShowFilteringRow = true;
                    //ParentGrid.Templates[0].HierarchyDataProvider = new GridViewEventDataProvider(ParentGrid.Templates[0]);

Any help would be appreciated!

Never mind everyone, found this nugget in the demo:

 private void SetupFiltering(GridViewTemplate template, bool enableFiltering)
            template.EnableFiltering = enableFiltering;

            for (int i = 0; i < template.Templates.Count; i++)
                SetupFiltering(template.Templates[i], enableFiltering);

No answers yet. Maybe you can help?

Asked by
Top achievements
Rank 2
Share this question