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

Google like filtering to three level hierarchy grid

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 04 Mar 2009, 07:33 AM
Hi ,
 I want to implement google like filtering to three level hierarchy (google like filtering to second and third level grid). To implement this
 i have tried following code but  when i click on combo box to display filtering it displays only loading.... When i try to debug then
it dose not go to "list_ItemsRequested" function in "MyCustomFilteringColumnCS" class file.

protected void  RadGrid1_PreRender(object sender, EventArgs e)  
     {  
         foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items) {  
             if (dataItem.Expanded) {  
                 GridTableView gridTableView = (GridTableView)dataItem.ChildItem.NestedTableViews[0];  
                 gridTableView.Columns.Clear();  
                 foreach (DataColumn dataColumn in ds.Tables[0].Columns)  
               {  
                     RadGrid.MyCustomFilteringColumn gridColumn = new RadGrid.MyCustomFilteringColumn();  
                      
                     gridColumn.DataField = dataColumn.ColumnName;  
                     gridColumn.HeaderText = dataColumn.ColumnName;  
                     gridTableView.Columns.Add(gridColumn);  
                 }  
                 gridTableView.Rebind();  
             }  
         }  
          
          
     }  

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 07 Mar 2009, 04:58 PM
Hello Rahul,

Unfortunately, you cannot add columns to the nested view when RadGrid PreRender is raised, because this event is fired late in the lifecycle and hence the grid cannot persist its viewstate. For further information how to create the grid programmatically you can review this link.

In my attempt to implement your requirements, I have created a test project which is attached to this thread. My custom column is declarated in the mark-up section and the hierarchy load mode is "ServerOnDemand".
If you still need to add columns programatically, you can examine our online demo to achieve your goal. I have to note that you can add columns to the nested view only before it is bound.

Regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Rahul
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or