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

Access the Footer Item of Detail Table

4 Answers 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Devi
Top achievements
Rank 1
Devi asked on 17 Sep 2008, 01:28 PM
 
Hi,


How can i access the footer item of details table in server validator.

the below coding is not entering into the loop

Please find the solutions.

   foreach (GridFooterItem fooitem in UI_GrdSchedule.MasterTableView.DetailTables[0].GetItems(GridItemType.Footer))
            {
                DropDownList ddlFitemOperatorA = ((DropDownList)(fooitem.FindControl("ddlFitemOperatorA")));
                user1 = Convert.ToInt16(ddlFitemOperatorA.SelectedValue);
}

Regards,
KamalPriya

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Sep 2008, 04:56 AM
Hi Devi,

Try accessing the footer item for the child table as shown below.

CS:
foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            if (item.Expanded) 
            { 
                GridTableView nestedView = ((GridDataItem)item).ChildItem.NestedTableViews[0]; 
                foreach (GridFooterItem childfooter in nestedView.GetItems(GridItemType.Footer)) 
                { 
                    DropDownList ddl = (DropDownList)childfooter.FindControl("DropDownList1"); 
                }  
            } 
        } 


Thanks
Shinu.
0
Devi
Top achievements
Rank 1
answered on 18 Sep 2008, 01:44 PM
Hi,

Thanks working fine....


How can i get the edititem of Detail Table ...

I just modified footer code but its not working can u pls suggest me


Thanks,
Regards,
KamalPriya
0
Shinu
Top achievements
Rank 2
answered on 19 Sep 2008, 03:47 AM
Hi Devi,

You can access the edit item of the Detail table in the ItemDataBound event. Since the ItemDataBound event gets raised at whatever level of the RadGrid's tables are getting bound,we need some kind of check to make sure which Detail table we're dealing with. Otherwise we will get an error when trying to locate the ""  field in the data item. So you can set the Name property for the Detail table and check the Name of  table in the ItemDataBound event.

ASPX:
<telerik:GridTableView runat="server" ShowFooter="true"  EditMode="InPlace"  Name="Detail" DataSourceID="SqlDataSource1" > 
                    

CS:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item.OwnerTableView.Name == "Detail") 
        { 
            if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) 
            {  
             
            } 
        } 
   } 


Thanks
Shinu.
0
Devi
Top achievements
Rank 1
answered on 19 Sep 2008, 07:15 AM
Hi,

Thanks working fine

Regards,
Kamalpriya.
Tags
Grid
Asked by
Devi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Devi
Top achievements
Rank 1
Share this question
or