This question is locked. New answers and comments are not allowed.
Hi,
I am using radgrid view and implementing export to excel functionality.It is working fine for small data but is showing error when i am trying to export large data.Is there a solution for this problem.
I am using radgrid view and implementing export to excel functionality.It is working fine for small data but is showing error when i am trying to export large data.Is there a solution for this problem.
5 Answers, 1 is accepted
0
Hi suresh,
Can you provide a bit more info about the grid version, how many records you are trying to export and what says the error?
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Can you provide a bit more info about the grid version, how many records you are trying to export and what says the error?
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
suresh
Top achievements
Rank 1
answered on 19 Oct 2009, 07:01 AM
Hi,
There are around 2000 records and error is Dialogs must be user initiated ans it is occurring at if(dialog.showdialog().value) condition.
Previously i used to get this error if i am having a break point in the code.But when it comes to large data i am getting this error even without any break point.
There are around 2000 records and error is Dialogs must be user initiated ans it is occurring at if(dialog.showdialog().value) condition.
Previously i used to get this error if i am having a break point in the code.But when it comes to large data i am getting this error even without any break point.
0
Hi,
I've tried this and indeed you can get such exception if you try to execute some slow operation before ShowDialog() method however you can easily fix this if you call desired grid method after this. Here is an example:
private void Button_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())
{
using (StreamWriter sw = new StreamWriter(stream, Encoding.UTF8))
{
sw.Write(RadGridView1.ToHtml());
}
stream.Close();
}
}
}
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I've tried this and indeed you can get such exception if you try to execute some slow operation before ShowDialog() method however you can easily fix this if you call desired grid method after this. Here is an example:
private void Button_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())
{
using (StreamWriter sw = new StreamWriter(stream, Encoding.UTF8))
{
sw.Write(RadGridView1.ToHtml());
}
stream.Close();
}
}
}
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
suresh
Top achievements
Rank 1
answered on 26 Oct 2009, 05:49 AM
Hi,
I have tried with the code.But i am still getting the error .
I have tried with the code.But i am still getting the error .
0
Hi,
I've attached small example demonstrating suggested approach. No errors on my end.
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I've attached small example demonstrating suggested approach. No errors on my end.
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
