I have a ReportViewer in my WinForms application to show some data in the form of a Telerik Report. I also have some textboxes, which will update the Report when the user leaves the textbox and the text has been changed.
private
void
SpediControl_Leave(
object
sender, EventArgs e)
{
Control ct = sender
as
Control;
// check if text in textbox has been changed
if
(ct.Text != s)
// s is the text of the textbox
{
// update spedi report
InstanceReportSource repSrcSpedi =
new
InstanceReportSource();
repSrcSpedi.ReportDocument =
new
Spedi(
this
);
repViewerSpediPreview.ReportSource = repSrcSpedi;
repViewerSpediPreview.RefreshReport();
}
}
After​ leaving a textbox, the ReportViewer gets the focus on itself. So I'm using UpdateUI event. To test if it gets fired, I just call a MessageBox:
private
void
repViewerSpediPreview_UpdateUI(
object
sender, EventArgs e)
{
MessageBox.Show(
"aaa"
);
}
To my surprise, the message box gets called 8 times. First, I thought the "_Leave()" event must have an error. But the Leave event is only triggered once (as expected). It's only the UpdateUI event which is triggered multiple times. Everything else is working as expected. Is this a known bug or can anyone please provide me some help?
Regards,
Danilo