问题:
在点击按钮查询显示Dundas图时,报错:Series["jjj"]丢失。
查了一下错误日志:发现,在PostBack时, Series的状态丢失。
解决方案:
在Chart中加一个属性 CallbackStateContent="All" ,即可保存和恢复Series和DataPoint的所有状态。
相关文档:
public enum CallbackStateContent : <mshelp:link errorurl="resolveh2link.html" tabindex="" options="0" indexmoniker="!DefaultAssociativeIndex" keywords="frlrfSystemEnumClassTopic;System.Enum">Enum</mshelp:link> |
| Member | Description |
|---|---|
| Auto | Automated selection of save/restore behaviour. |
| ChartStateOnly | Saves and restores the all chart state without series data points. |
| SeriesDataOnly | Saves and restores the only chart series data points. |
| All | Saves and restores the all chart state including series data points. |
| None | Saving and restoring will be not performed. |
| Visual Basic | Copy Code |
|---|---|
Imports Dundas.Charting.WebControl | |
| C# | Copy Code |
|---|---|
using Dundas.Charting.WebControl; | |
- All - if UI is activated (Toolbar and context menu).
- SeriesDataOnly - if scrolling and zooming is enabled, and the particular series is not using data-binding.
- None - in all other cases including when user callback is used.
<mshelp:link errorurl="resolveh2link.html" tabindex="" options="0" indexmoniker="!DefaultAssociativeIndex" keywords="frlrfSystemObjectClassTopic;System.Object">System.Object</mshelp:link>
<mshelp:link errorurl="resolveh2link.html" tabindex="" options="0" indexmoniker="!DefaultAssociativeIndex" keywords="frlrfSystemValueTypeClassTopic;System.ValueType">System.ValueType</mshelp:link>
<mshelp:link errorurl="resolveh2link.html" tabindex="" options="0" indexmoniker="!DefaultAssociativeIndex" keywords="frlrfSystemEnumClassTopic;System.Enum">System.Enum</mshelp:link>
Dundas.Charting.WebControl.CallbackStateContent
本文介绍了解决Dundas图表在PostBack时丢失Series数据的问题。通过设置Chart组件的CallbackStateContent属性为All,可以确保Series和DataPoint状态的完整保存与恢复。
46

被折叠的 条评论
为什么被折叠?



