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

Expand/Collapse Icon disappears in Hierarchical Grid after the recreation of Hierarchical structure with telerik version 2013.2.717.35

3 Answers 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Narrmadha
Top achievements
Rank 1
Narrmadha asked on 20 Dec 2013, 05:34 AM
Hi,

I have written the code for Hierarchical Grid as per the reply of support ticket id : 660933.Its working fine.

I need to recreate the structure for Hierarchical Grid every-time on button click.(because columns & rows & Childtables of grid will get changed on button click with respect to some settings as per our requirement).

If I refer 2013.2.717.35 telerik trial version dll in my code,
Scenario:
On InitLoad, the grid shows expand icon for child rows.When I click button, the expand icon disappears in the grid for child rows,once I have changed the pagesize of grid,the grid shows expand icon for child rows.

But if I refer 2012.3.1308.35 telerik trial version dll in the code,the above scenario works fine.

How to overcome the issue expand icon disappears in the grid for child rows on button click with  2013.2.717.35 telerik dll reference? Please provide me the solution as soon as possible. Thanks in advance.

Sample Code Snippet:

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            rdGrdCollapsibleGrid.Columns.Clear();
            rdGrdCollapsibleGrid.MasterTableView.DetailTables.Clear();    
            DataSet ds = getMockDataForCG();
            CreateHierarchicalGridStructure(rdGrdCollapsibleGrid, ds);
            rdGrdCollapsibleGrid.DataBind();        
        }   
    }

    protected void rdGrdCollapsibleGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        if (!e.IsFromDetailTable)
        { 
            DataSet ds = getMockDataForCG();
            if (ds.Tables[ds.Tables.Count - 2] != null && ds.Tables[ds.Tables.Count - 2].Rows.Count > 0)
                rdGrdCollapsibleGrid.VirtualItemCount = Convert.ToInt32(ds.Tables[ds.Tables.Count - 2].Rows[0][ds.Tables[ds.Tables.Count - 2].Columns.Count - 1]);
            rdGrdCollapsibleGrid.DataSource = ds.Tables[0];
        }       
    }

  protected void rdGrdCollapsibleGrid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
    {      
          //Here code for binding data onto respective detail table of  grid
    }

    protected void btnRecreate_Click(object sender, EventArgs e)
    {
        rdGrdCollapsibleGrid.Columns.Clear();
        rdGrdCollapsibleGrid.MasterTableView.DetailTables.Clear();
        DataSet ds = getMockDataForCG();
       CreateHierarchicalGridStructure(rdGrdCollapsibleGrid, ds);
       rdGrdCollapsibleGrid.Rebind();
    }

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 25 Dec 2013, 02:26 PM
Hello Narrmandha,

I have already replied to your query in thread with ID: 770203. I suggest that we continue our discussion on the mentioned thread to enable other developers with similar issues to track the discussion more easily.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Narrmadha
Top achievements
Rank 1
answered on 26 Dec 2013, 02:13 PM
Hi,

i am getting error page while trying to reply to the thread with ID: 770203.So I am continuing with this thread to get clarification for my queries.

I have implemented the code in the same way as the example specified in the provided link & also tried out the suggested solution with 2013.2.717.35 telerik trial version dll. Its not working,same issue persist.
 
My question is that if the way of implementation is not correct means ,the expected scenario should not work with 2012.3.1308.35 telerik trial version dll reference.But the below scenario works fine with 2012.3.1308.35 telerik trial version dll reference

Scenario:
On InitLoad, the grid shows expand icon for child rows.When I click button, the expand icon disappears in the grid for child rows,once I have changed the pagesize of grid,the grid shows expand icon for child rows.


the above scenario not works with 2013.2.717.35 telerik trial version dll reference.Please check both telerik version dlls with the sample code that i have attached in the thread with ID: 770203

 Please provide me the solution as soon as possible. Thanks in advance.
 

0
Eyup
Telerik team
answered on 03 Jan 2014, 09:22 AM
Hello Narrmadha,

First of all, note that the purpose of Code Libraries is to provide convenient samples for various scenarios - they are not meant to be used for technical questions/problems. Please avoid creating code libraries with this goal.

Nevertheless, I have checked your sample thoroughly and come to the supposition that you are trying to create and alter the grid structure dynamically. Before proceeding to the version differences, you will need to implement the following changes so that this requirement remains in our support scope:

1. Place your ScriptManager and RadAjaxManager on the master page:
http://www.telerik.com/help/aspnet-ajax/ajax-masterpage.html

2. Remove any DataBind() from your code-behind and replace them with Rebind()(only if necessary) while binding the grid via NeedDataSource and DetailTableDataBind events:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/programmatic-hierarchy/defaultcs.aspx

3. To change the grid columns' structure dynamically, you need to create the grid entirely on code-behind:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html#Section22

4. You will need to closely follow the steps provided in this article:
http://www.telerik.com/help/aspnet-ajax/grid-changing-structure-dynamically.html

Please make the suggested modifications and if the issue remains, open a support ticket to send us a very basic runnable web site representing the isolated version of your project to demonstrate the problematic behavior.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Narrmadha
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Narrmadha
Top achievements
Rank 1
Share this question
or