I have included the codel-behind (Visual Basic 2.0)
Protected Sub
rgCUBudget_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs)
Dim
dataItem As Telerik.Web.UI.GridDataItem = CType(e.DetailTableView.ParentItem, Telerik.Web.UI.GridDataItem)
Select Case
e.DetailTableView.Name
Case "AccountDetail"
tbBudget = LoadObject(tbBudget)
tbBudget.AccountId = dataItem.GetDataKeyValue("account_id").ToString()
e.DetailTableView.DataSource = tbBudget.LoadBudgetAccountDetail()
Case
"AccountSummary"
tbBudget = LoadObject(tbBudget)
tbBudget.SiteId = dataItem.GetDataKeyValue("site_id").ToString()
e.DetailTableView.DataSource = tbBudget.LoadBudgetAccountSummary()
Case
"SiteSummary"
tbBudget = LoadObject(tbBudget)
tbBudget.DivisionId = dataItem.GetDataKeyValue("division_id").ToString()
e.DetailTableView.DataSource = tbBudget.LoadBudgetSiteSummary()
End Select
End Sub
Protected Sub
rgCUBudget_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
If
e.CommandName = "loadSites" Then
For Each
item As GridDataItem In rgCUBudget.Items
If item.OwnerTableView.Name = "DivisionSummary" Then
tbBudget = LoadObject(tbBudget)
tbBudget.DivisionId = CType(item, GridDataItem).GetDataKeyValue("division_id").ToString()
End If
Next
End If
End Sub
Protected Sub
rgCUBudgetDetail_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs)
Dim
dataItem As Telerik.Web.UI.GridDataItem = CType(e.DetailTableView.ParentItem, Telerik.Web.UI.GridDataItem)
Select Case
e.DetailTableView.Name
Case "AccountDetail2"
tbBudget = LoadObject(tbBudget)
tbBudget.AccountId = dataItem.GetDataKeyValue("account_id").ToString()
e.DetailTableView.DataSource = tbBudget.LoadBudgetAccountDetail()
Case
"AccountSummary2"
tbBudget = LoadObject(tbBudget)
tbBudget.SiteId = dataItem.GetDataKeyValue("site_id").ToString()
e.DetailTableView.DataSource = tbBudget.LoadBudgetAccountSummary()
Case
"SiteSummary2"
tbBudget = LoadObject(tbBudget)
tbBudget.DivisionId = dataItem.GetDataKeyValue("division_id").ToString()
e.DetailTableView.DataSource = tbBudget.LoadBudgetSiteSummary()
End Select
End Sub