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

Google like filtering in Hierarchy

1 Answer 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ashwini
Top achievements
Rank 1
ashwini asked on 27 Feb 2009, 10:47 AM


Hi

  The filtering of the columns is shown on the simple grid.
But I want the same thing in the Hierarchical grid.
I want that the filtering must appear on the 2nd and 3rd level of the hierarchical grid i.e the first level must not have any filtering.
Please help me with this. OR just Suggest whether it is possible or not with hierarchical grid.



Thanks in advance.
Regrads,
Ashwini

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Mar 2009, 11:19 AM
Hi  Ashwini,

In the PreRender event you can access the NestedTableView and then clear the columns to add the custom filtering column . I have made use of the code snippet in the help document  http://www.telerik.com/help/aspnet-ajax/grdtraversingdetailtablesitemsingrid.html

VB
 Protected Sub RadGrid1_PreRender(ByVal sender As ObjectByVal e As System.EventArgs) Handles RadGrid1.PreRender 
        For Each dataItem As GridDataItem In RadGrid1.MasterTableView.Items 
            If dataItem.Expanded Then 
                Dim gridTableView As GridTableView 
                gridTableView = dataItem.ChildItem.NestedTableViews(0) 
                gridTableView.Columns.Clear() 
                For Each dataColumn As DataColumn In ds.Tables(0).Columns 
                    Dim gridColumn As RadGrid.MyCustomFilteringColumn = New RadGrid.MyCustomFilteringColumn 
 
                    gridColumn.DataField = dataColumn.ColumnName 
                    gridColumn.HeaderText = dataColumn.ColumnName 
                    gridTableView.Columns.Add(gridColumn) 
                Next 
                gridTableView.Rebind() 
            End If 
 
        Next 
           
    End Sub 

Thanks,
Princy
Tags
Grid
Asked by
ashwini
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or