protected void reportGridView_DetailRowExpandedChanged(object sender, EventArgs e) { reportGridView.CurrentFocusedRow = ((ASPxGridViewDetailRowEventArgs)e).VisibleIndex; reportGridView.FocusedRowIndex = reportGridView.CurrentFocusedRow; if (IsReportWithNotesLiteral.Text.ToLower() == "true" && ((ASPxGridViewDetailRowEventArgs)e).Expanded) { try { reportGridView.DetailRows.CollapseAllRows(); reportGridView.FindDetailRowTemplateControl(reportGridView.CurrentFocusedRow, ((sender as CffGridView).ID)); reportGridView.Templates.DetailRow = new AgedBalancesNotesDetailRowTemplate("Created", ((sender as CffGridView).GetRow(reportGridView.CurrentFocusedRow) as AgedBalancesReportRecord).CustNoteList, ((sender as CffGridView).ID), reportGridView.CurrentFocusedRow); reportGridView.DetailRows.ExpandRow(reportGridView.CurrentFocusedRow); } catch { } } else if (IsReportWithNotesLiteral.Text.ToLower() == "true") { reportGridView.FindVisibleIndexByKeyValue(reportGridView.CurrentFocusedRow); reportGridView.FindDetailRowTemplateControl(reportGridView.CurrentFocusedRow, ((sender as CffGridView).ID)); reportGridView.DetailRows.CollapseRow(reportGridView.CurrentFocusedRow); } else { reportGridView.DetailRows.CollapseRow(reportGridView.CurrentFocusedRow); } }