First let me establish a little background on what I'm trying to achieve.
I have an ASP.NET page where approximately 20+ areas are shown. For each area I would like to create a hover over popup with realtime callback refreshing. On the popup it would show between 1 to 5 gauge controls (for different data points) and a line graph having all gauge points charted for the last 8 hours. When attempting to do this I was thinking I could structure with an ASPxCallback panel having the 1-5 gauges and line chart all embedded on a ASPxPopupControl but soon ran into issues as follows:
- Had to add each gauge / chart with their own callback hook, otherwise created annoying flashing on UI. If I call back on each gauge and chart, then the refresh was smooth.
- Having 20+ areas would result in somewhere around 100 callback hooked controls if I brute force implemented it this way. Not to mention it increased the HTML produced to an astronomical size.
- If I wrapped it all into a single control, still required lots of code to be placed in code behind file, even though almost all items have the exact same method to pull the data.
So what I was hoping to do is create a custom control wrapping in all the gauges and chart so that I can add just one to the screen and depending on the hover over, have the popup appear there and refresh. My thought was the control would have an attribute field of something like DataPoints where you could set it to the points you cared about for a particular area like DataPoints="DP-123;DP-435;". So for me to achieve this I need the following questions answered:
- Can I hook the callback routines to objects other then the corresponding code behind files much like hooking other AJAX related calls to Web Service methods. So for example, could I build into my custom control a means to retrieve it's own data. Thus if I added the attribute of DataPoints="DP-123;DP-153;", this would mean I have 2 gauges and the chart. The control then would know how to pull the 2 gauges current values and the line graph history. This would make the control very much a reusable object.
- Is there a way I can refresh the panel smoothly by simply refreshing at the callback panel level? Today if I refresh at the callback panel, all the gauges and charts flash (even without loading panel). If I place the callbacks on the gauges and charts, this is smooth with no flashing but then 5 times the callback hooks.
- How can I re-use a single ASPxPopupControl for all 20+ points and just dynamically refresh? So in the JavaScript call pass in the DataPoints and dynamically perform callback to immediately reconfigure control for that point.
I realize without a full example, I'm not going to get a complete answer but for now I'm really looking for some pointers on what can and cannot be done and perhaps some references.
Thanks, Shane