protected void btnExpand_Click(object sender, EventArgs e) { LinkButton button1 = (LinkButton)sender; if (button1.Text == "+") { foreach (GridDataItem gvr in this.rdAssociatePayout.Items) { DataTable dtIssueDetail; int issueId = 0; string PAG_AssetGroupCode, PAISC_AssetInstrumentSubCategoryCode, AAC_AgentCode, commissionType; DateTime PayOutDate; LinkButton button = (LinkButton)gvr.FindControl("lbDetails"); RadGrid gvChildDetails = (RadGrid)gvr.FindControl("rgNCDIPOMIS"); Panel PnlChild = (Panel)gvr.FindControl("pnlchild"); issueId = int.Parse(rdAssociatePayout.MasterTableView.DataKeyValues[gvr.ItemIndex]["AIM_IssueId"].ToString()); AAC_AgentCode = rdAssociatePayout.MasterTableView.DataKeyValues[gvr.ItemIndex]["AgentCode"].ToString(); PAG_AssetGroupCode = rdAssociatePayout.MasterTableView.DataKeyValues[gvr.ItemIndex]["PAG_AssetGroupCode"].ToString(); PAISC_AssetInstrumentSubCategoryCode = rdAssociatePayout.MasterTableView.DataKeyValues[gvr.ItemIndex]["PAISC_AssetInstrumentSubCategoryCode"].ToString(); commissionType = rdAssociatePayout.MasterTableView.DataKeyValues[gvr.ItemIndex]["WCD_CommissionType"].ToString(); PayOutDate = DateTime.Parse(rdAssociatePayout.MasterTableView.DataKeyValues[gvr.ItemIndex]["WCD_Act_Pay_BrokerageDate"].ToString()); dtIssueDetail = commisionReceivableBo.GetAgentProductWiseCommissionDetails(AAC_AgentCode, PAG_AssetGroupCode, PAISC_AssetInstrumentSubCategoryCode, issueId, advisorVo.advisorId, PayOutDate, commissionType); gvChildDetails.DataSource = dtIssueDetail; gvChildDetails.DataBind(); if (PnlChild.Visible == false) { PnlChild.Visible = true; button.Text = "-"; } } button1.Text = "-"; } else { foreach (GridDataItem gvr in this.rdAssociatePayout.Items) { LinkButton button = (LinkButton)gvr.FindControl("lbDetails"); Panel PnlChild = (Panel)gvr.FindControl("pnlchild"); if (PnlChild.Visible == true) { PnlChild.Visible = false; } button.Text = "+"; } button1.Text = "+"; } }