I have beeen using export to excel function from the radgrid control for silverlight. Now I do have a requirement to show up a drop down in excel as one of the columns with some predefined values. Is that possible to do it.
code snippet:
private void ButtonExport_Click(object sender, RoutedEventArgs e)
{
string extension = "xls";
SaveFileDialog dialog = new SaveFileDialog()
{
DefaultExt = extension,
Filter = String.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", extension, "Excel"),
FilterIndex = 1
};
if (dialog.ShowDialog() == true)
{
using (Stream stream = dialog.OpenFile())
{
gridView.Export(stream,
new GridViewExportOptions()
{
Format = ExportFormat.Html,
ShowColumnHeaders = true,
ShowColumnFooters = false,
ShowGroupFooters = false
});
}
}
}
code snippet:
private void ButtonExport_Click(object sender, RoutedEventArgs e)
{
string extension = "xls";
SaveFileDialog dialog = new SaveFileDialog()
{
DefaultExt = extension,
Filter = String.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", extension, "Excel"),
FilterIndex = 1
};
if (dialog.ShowDialog() == true)
{
using (Stream stream = dialog.OpenFile())
{
gridView.Export(stream,
new GridViewExportOptions()
{
Format = ExportFormat.Html,
ShowColumnHeaders = true,
ShowColumnFooters = false,
ShowGroupFooters = false
});
}
}
}