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

[Solved] Grid with hireachy and Tabs

3 Answers 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Asra
Top achievements
Rank 1
Asra asked on 10 Jun 2009, 11:58 AM
Hi All,
           I am using Rad grid in order to bind the gird.
I have one Main Grid. Inside the MainGrid there two Tab Controls. One of the TabControl is having Grid and the Other TabControl is having Charts.

The first MainGrid iam binding it in the page_load. And the second Grid  which is inisde the tab, iam binding it in the MainGrid_ItemCreated Event.  It works fine like this, but the problem is the Item_created gets called for event. Because  of this it the grid is getting binded many times.

Can any one pls let me know what is the best way to bind the grid inside the tab. If i wont use Item_created event, then the tab is  not displaying the Grid.

Pls give me suggestions..
Its very very urgent

Regards,

asra
protected void CategoryGrid_ItemCreated(object sender, GridItemEventArgs e)  
    {  
 
if (e.Item is GridNestedViewItem)  
            {  
                  //Find the RadGrid  
                radProdGrid = e.Item.FindControl("radProdutsGrid"as RadGrid;  
                // Find the chart  
                rcProduct = e.Item.FindControl("RadChart2"as RadChart;  
 radProdGrid.DataSource = productInfoView;  
 
}  

3 Answers, 1 is accepted

Sort by
0
Taran
Top achievements
Rank 1
answered on 10 Jun 2009, 05:10 PM
Hi Asra,

You can try PreRender event of the grid i.e. RADGrid1_PreRender.

Regards,
Taran
0
Shinu
Top achievements
Rank 2
answered on 11 Jun 2009, 04:45 AM
Hi Asra,

Try binding the Child Grid in the ItemCommand event as shown below.

CS:
 
protected void CategoryGrid_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if ((e.CommandName == "ExpandCollapse")&&(!e.Item.Expanded)) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            GridNestedViewItem childItem = (GridNestedViewItem)item.ChildItem; 
            RadGrid Grid = (RadGrid)childItem.FindControl("radProdutsGrid"); 
        } 
    } 


Regards
Shinu
0
Asra
Top achievements
Rank 1
answered on 11 Jun 2009, 06:25 AM
Hi,
Thnx for your reply.
As this child Grid is availble with TabPageview, in the item command Event it is getting binded but iam not able to see the records. It is showing me as no records to display.
i have even tried with the prerender event, even there iam not able to see the records.

Its very urgent, as to day is the last day for me to fix this up..

Pls help on this .

Regards,
Asra
Tags
Grid
Asked by
Asra
Top achievements
Rank 1
Answers by
Taran
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Asra
Top achievements
Rank 1
Share this question
or