This is a migrated thread and some comments may be shown as answers.

How do I stop losing values on navigation?

3 Answers 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 06 May 2011, 06:28 PM
If I set values on the report in the codebehind (so lets say textBox1.Value = dataItem.Name)

When I navigate to a sub report, then navigate back to the master, textBox1 no longer has the value I assigned to it...

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 11 May 2011, 05:49 PM
Hi Steve,

Are you trying to change the code serialized in the InitializeComponent method? What do you mean by "When I navigate to a sub report, then navigate back to the master"? Generally we highly recommend to avoid changing the report designer serialized code and instead use the report designer. Let us know if this is not the case.

Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 11 May 2011, 05:54 PM
Hey Peter,

It's in the crosstabs NeedsDataSource event...I have the dataset so I just use one of the values to set the title
0
Peter
Telerik team
answered on 12 May 2011, 03:13 PM
Hello Steve,

Since Q3 2010 the NeedDataSource event is meant to be used only for providing a data source to the report and then the retrieved data is cached unless changed i.e. once cached the NeedDataSource event is not fired again and as you probably know every time when the report is previewed, paged or exported through the viewer it is processed and rendered from scratch. During this processing, the cached data is used, but the Values you have set in the NeedDataSource event are not  being set as the event is not fired second time unless refresh is invoked or a parameter value is changed. If you set a break-point within the NeedDatasource handler you should be able to observe the described behavior. That is why any other changes to report items should be moved to the ItemDataBinding event, which is fired regardless.

If you still experience any difficulties we will appreciate if you send us a report that exhibits the described behavior to debug and analyze locally.

All the best,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Peter
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or