Hi,
I am developing many widgets on one screen. I have used MVP DP so whether or not to create instances of widgets (maybe based on role) are determined by presenter.
One control is RadHtmlChart:PieSeries which also has <asp:Timer> and the other is RadProgressBar.
The Timer postbacks the entire page, not just the PieControl which is OK.
This is the presenter.cs code for the PieSeries which correctly repaints the UI when the timer goes off.
The presenter.cs code for the ProgressBar is identical.
However, it only works the first time databind. Every other postback the new "PercentagteValue" is assigned correctly but the control doesn't seem to overwrite it's older value.
For now i got it to work by declaratively creating the control on the widget page instead of dynamically creating it in the presenter.
I've seen posts on set_value using javascript but was wondering why these two controls act differently?
public
async Task GetPieSnapShot()
{
IEnumerable<PieData> pieResult = await Model.GetPieData();
PieSeries myPieControl = (PieSeries)LoadControl(
"~/UserControls/PieSeriesControl.ascx"
);
myPieControl.DataSource = pieResult.ToList();
View.PieWidget = myPieControl;
}