As per my understanding, you are having some TextBoxes and a C1DataGrid in your main window and you want to export all of them in to a Excel Sheet. Let me know you that there is no inbuilt functionality provided by .Net to export all the components of a container control into a Excel sheet.
As a workaround, you are suggest to use C1XLBook and add all the information into it and then export it into a Excel sheet.
Here is the suggested code:
private void btn_Export_Click(object sender, RoutedEventArgs e)
C1XLBook book = new C1XLBook();
XLSheet sheet = book.Sheets;
sheet[0,0].Value = txt.Text;
XLStyle style1 = new XLStyle(book);
style1.Font = new XLFont("Times New Roman", 18, true, false);
style1.AlignHorz = XLAlignHorzEnum.Center;
sheet.Rows.Style = style1;
XLCellRange _ColRange = new XLCellRange(0, 0, 0, 5);
for (int i = 1; i <= c1DataGrid.Rows.Count-1; i++)
sheet[i, 0].Value = c1DataGrid[i, 0].Value;
sheet[i, 1].Value = c1DataGrid[i, 1].Value;
sheet[i, 2].Value = c1DataGrid[i, 2].Value;
sheet[i, 3].Value = c1DataGrid[i, 3].Value;
Please find the attached sample implementing the above and let me know if I missed something.