private void btnReport_Click(object sender, EventArgs e) { RibbonButton senderButton = sender as RibbonButton; Report report = ReportsRepo.GetById(Convert.ToInt16(senderButton.Value)); FrmReportFlexible frmReportFlexible = new FrmReportFlexible(report) { MdiParent = this }; frmReportFlexible.Show(); }
private void CreateReportsList() { List <Report> lstReports = ReportsRepo.GetAll(); ribbonPanelReports.Items.Clear(); foreach (var report in lstReports) { RibbonButton newButton = new RibbonButton() { Name = string.Format("btnReport{0}", report.Name), Text = report.Name, Value = report.Id.ToString() }; newButton.Click += new EventHandler(this.btnReport_Click); ribbonPanelReports.Items.Add(newButton); } }