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

their is any serverside event for radgrid nested view

5 Answers 231 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shabbir
Top achievements
Rank 1
Shabbir asked on 13 Jan 2009, 03:03 PM
Hello All,
which event can I used to fire when I click the radgrid nested view to get parent datakeyname.
 
thanks in advance
shabbir

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Jan 2009, 04:48 AM
HI Shabbir,

I hope you are trying to access the key value of a row on clicking the expand/collapse button.

Here is the code:
  protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if(e.CommandName == "ExpandCollapse"
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            string strkey = item.GetDataKeyValue("ProductID").ToString(); 
        } 
    } 


If this is not your requirement please consider sending your aspx as well.

Shinu
0
Shabbir
Top achievements
Rank 1
answered on 14 Jan 2009, 05:15 AM
HI Shinu

Thanks a lot, my problem resolved through your suggestion.

Again thanks,
Shabbir Hussain.
0
Shabbir
Top achievements
Rank 1
answered on 14 Jan 2009, 06:01 AM
HI Shinu,
 One more help plz, can I find out their nested controls. I want this, see below.

 

protected void AD_View_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

    if (e.CommandName == "ExpandCollapse")

 

    {

 

 

        GridDataItem item = (GridDataItem)e.Item;

 

        item.Selected =

true;

 

 

        string strkey = item.GetDataKeyValue("AD_ID").ToString();

 

 

        this.Title = this.Title + strkey + " Mode(Expand): " + ((item.Expanded) ? false : true) ;

 

 

        Label lbl = (Label)item.FindControl("lblRowNumber");

 

        
        //EDR_View this is nested grid
        RadGrid grdEDR_View = (RadGrid)item.FindControl("EDR_View");
        if (grdEDR_View != null)
        {
            grdEDR_View.DataSource = GET_EDR_Records(strkey);
        }

    }

 

}

0
Princy
Top achievements
Rank 2
answered on 14 Jan 2009, 10:19 AM
Hello Shabbir,

You can try out the following code to access the RadGrid in the NeatedViewTemplate and set its DataSource.
cs:
protected void AD_View_ItemCommand(object source, GridCommandEventArgs e)  
    {  
       if (e.CommandName == "ExpandCollapse")  
         {  
                GridDataItem item = (GridDataItem)e.Item; 
                item.Selected = true
                string strkey = item.GetDataKeyValue("AD_ID").ToString(); 
                thisthis.Title = this.Title + strkey + " Mode(Expand): " + ((item.Expanded) ? false : true) ; 
                Label lbl = (Label)item.FindControl("lblRowNumber"); 
                  foreach (GridNestedViewItem item1 in RadGrid1.MasterTableView.GetItems(GridItemType.NestedView)) // loop through the nested items of a NestedView Template 
                    {  
                         RadGrid grid = (RadGrid)item1.FindControl("EDR_View");  
                         grid.DataSource = GET_EDR_Records(strkey); 
                    }  
          }  
    }  

Thanks
Princy.
0
Dhamodharan
Top achievements
Rank 1
answered on 29 Nov 2010, 08:56 AM
 foreach (GridNestedViewItem item1 in RadGrid1.MasterTableView.GetItems(GridItemType.NestedView)) // loop through the nested items of a NestedView Template 
                    {  
                         RadGrid grid = (RadGrid)item1.FindControl("EDR_View");  
                         grid.DataSource = GET_EDR_Records(strkey); 
                    }

How to get label values into grid - EDR_View




Thanks,
Dhamu
Tags
Grid
Asked by
Shabbir
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Shabbir
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Dhamodharan
Top achievements
Rank 1
Share this question
or