Hi
Which is the best way to export xamlgrid to excell sheet?
Thanks
MK
foreach (Record record in this.xamDataGrid1.ViewableRecords)
{
StringBuilder recordAsString = new StringBuilder(); if (record is DataRecord) { foreach (Cell cell in ((DataRecord)record).Cells) { recordAsString.Append(cell.Value.ToString() + ","); } } // Feed this 'record as string' to Excel. For now, just print it in the debug window. Debug.Print(recordAsString.ToString());
StringBuilder recordAsString = new StringBuilder();
if (record is DataRecord)
foreach (Cell cell in ((DataRecord)record).Cells) { recordAsString.Append(cell.Value.ToString() + ","); }
foreach (Cell cell in ((DataRecord)record).Cells)
recordAsString.Append(cell.Value.ToString() + ",");
}
// Feed this 'record as string' to Excel. For now, just print it in the debug window.
Debug.Print(recordAsString.ToString());
This works fine if the data hasn't gone through a converter. Is there a way to the "actual" text from the cell. For example, i'm trying to get walk the viewable records for export. When i come across "7/15/2008" in my cell.value this is actually displayed as Tue and not the date. If i could get to the textblock inside cellvaluepresenter, would that work?