void generator_CustomizeColumn(object source, ControlCustomizationEventArgs e) { if (e.FieldName == "Discontinued") { XRShape control = new XRShape(); control.SizeF = e.Owner.SizeF; control.LocationF = new System.Drawing.PointF(0, 0); e.Owner.Controls.Add(control); control.Shape = new ShapeStar() { StarPointCount = 5, Concavity = 30 }; control.BeforePrint += new System.Drawing.Printing.PrintEventHandler(control_BeforePrint); e.IsModified = true; } }
void InitDetailsAndPageHeader(MVCxGridViewState gridViewState) { GridViewDataColumnStateCollection groupedColumns = gridViewState.GroupedColumns; int pagewidth = (report.PageWidth - (report.Margins.Left + report.Margins.Right)) - groupedColumns.Count * subGroupOffset; List <MVCxColumnInfo> columns = GetColumnsInfo(gridViewState, pagewidth); CustomizeColumnsCollection(report, new ColumnsCreationEventArgs(pagewidth) { ColumnsInfo = columns }); report.Bands.Add(new DetailBand() { HeightF = bandHeight }); report.Bands.Add(new PageHeaderBand() { HeightF = bandHeight }); XRTable headerTable = new XRTable(); XRTableRow row = new XRTableRow(); XRTable detailTable = new XRTable(); XRTableRow row2 = new XRTableRow(); for (int i = 0; i < columns.Count; i++) { if (columns[i].IsVisible) { XRTableCell cell = new XRTableCell(); cell.Width = columns[i].ColumnWidth; cell.Text = columns[i].FieldName; row.Cells.Add(cell); XRTableCell cell2 = new XRTableCell(); cell2.Width = columns[i].ColumnWidth; ControlCustomizationEventArgs cc = new ControlCustomizationEventArgs() { FieldName = columns[i].FieldName, IsModified = false, Owner = cell2 }; CustomizeColumn(report, cc); if (cc.IsModified == false) { cell2.DataBindings.Add("Text", null, columns[i].FieldName); } detailsInfo.Add(columns[i].GridViewColumn, cell2); row2.Cells.Add(cell2); } } headerTable.Rows.Add(row); headerTable.Width = pagewidth; headerTable.LocationF = new PointF(groupedColumns.Count * subGroupOffset, 0); headerTable.Borders = BorderSide.Bottom; detailTable.Rows.Add(row2); detailTable.LocationF = new PointF(groupedColumns.Count * subGroupOffset, 0); detailTable.Width = pagewidth; report.Bands[BandKind.PageHeader].Controls.Add(headerTable); report.Bands[BandKind.Detail].Controls.Add(detailTable); }