private void _frm_AfterSave(object sender, AddReportTemplate.AddReportTemplateArgs e) { this.LoadAdditionalDataReportTemplates(); for (int i = 0; i < gvReportTemplate.RowCount; i++) { CTAdditionalDataReportTemplate _item = gvReportTemplate.GetRow(i) as CTAdditionalDataReportTemplate; if (_item.id == e.ReportTemplateId) { gvReportTemplate.FocusedRowHandle = i; break; } } }
private void btnNewTemplate_Click(object sender, EventArgs e) { AddReportTemplate _frm = new AddReportTemplate(); PopupDialog _dlg = new PopupDialog(); _frm.AfterSave += new AddReportTemplate.AfterSaveEventHandler(_frm_AfterSave); _dlg.FormBorderStyle = FormBorderStyle.FixedSingle; _dlg.MinimizeBox = false; _dlg.MaximizeBox = false; _dlg.StartPosition = FormStartPosition.CenterScreen; _dlg.Text = "Add Report Template"; _dlg.Controls.Add(_frm); _dlg.ClientSize = new Size(_frm.Width + 2, _frm.Height + 2); _dlg.ShowDialog(this.ParentForm); }