or
int rowCount = importxls.ActiveWorksheet.UsedCellRange.RowCount;
int lastcolumn = importxls.ActiveWorksheet.UsedCellRange.ColumnCount;
MessageBoxResult result = MessageBox.Show(rowCount.ToString());
// Create a new checkbox and set its properties
CheckBox checkbox = new CheckBox();
checkbox.IsChecked = true;
checkbox.VerticalAlignment = VerticalAlignment.Center;
checkbox.Margin = new Thickness(5, 0, 0, 0);
DependencyProperty chkBox = DependencyProperty.Register(
"Select", typeof(bool), typeof(CheckBox),
new UIPropertyMetadata(checkbox.IsChecked));
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
{
// Add the checkbox to the current row
RowSelection rowSelection = importxls.ActiveWorksheet.Rows[rowIndex];
CellIndex cellIndex = new CellIndex(rowIndex, lastcolumn);
CellSelection cellSelection = rowSelection.Worksheet.Cells[cellIndex];
cellSelection.SetValue(DateTime.Now); //checkbox should be here
}
When ShowGroupHeaderRowAggregates is left as True, the header aggregates are not appearing above the appropriate cells upon exporting to Excel (ExportToXlsx), but rather all scrunched together and an utterly useless mess. The RadGridView on the client looks correct as the following is set: ColumnAggregatesAlignment="NextToGroupKey" in the XAML.
What do we need to do to properly align the aggregate columns in the header for the Excel export functionality? Are there any solid examples of how to do this?
Thank you.