I recently converted from the AjaxControlToolKit web tab to the Infragistics Web Tab, version 11.1.20111.2020 and I cannot figure out why my child controls are being lost on postback. These controls are not dynamic - they have been added to the designer. I removed all AJAX related code as a test (UpdatePanel, UpdateProgress) and I am still having the problem. The web tab's EnableViewState property is set to true.
Here is a single tab with an ultrachart. I have a button that will do a full postback (outside of this web tab) which updates the dataset with some filtered criteria. When I try to reference UltraChart1 in the Click event of the button I keep getting "Object Not set to Instance of an object", and sure enough the value of UltraChart1 is nothing. If I put UltraChart1 outside of the webtab, it works fine. Can you please tell me what I'm doing wrong, or what I need to add to the WebTab?
<ig:WebTab ID="tabReport" runat="server" Width="100%" Font-Size="Small" EnableViewState="true" EnableAjaxViewState="true">
<tabs>
<ig:ContentTabItem runat="server" Text="Graph">
<Template>
<igchart:UltraChart ID="UltraChart1" runat="server" ChartType="PieChart3D"
Version="11.1" Width="700px" Height="500px" BackgroundImageFileName="" Transform3D-Scale="100"
Transform3D-XRotation="54">
<Legend Visible="True" Location="Bottom"></Legend>
<Effects>
<igchartprop:GradientEffect />
</Effects>
<TitleTop Font="Microsoft Sans Serif, 14.25pt" HorizontalAlign="Center"
Text="Location Totals">
</TitleTop>
<ColorModel AlphaLevel="255" ColorBegin="Pink" ColorEnd="DarkRed"
ModelStyle="CustomLinear">
</ColorModel>
<PieChart3D PieThickness="15">
</PieChart3D>
<Axis>
<PE ElementType="None" Fill="Cornsilk" />
<X LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="False">
<MajorGridLines AlphaLevel="255" Color="Gainsboro" DrawStyle="Dot"
Thickness="1" Visible="True" />
<MinorGridLines AlphaLevel="255" Color="LightGray" DrawStyle="Dot"
Thickness="1" Visible="False" />
<Labels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near"
ItemFormatString="<ITEM_LABEL>" Orientation="Horizontal"
VerticalAlign="Center" Visible="False">
<SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" FormatString=""
HorizontalAlign="Near" Orientation="Horizontal" VerticalAlign="Center">
<Layout Behavior="Auto">
</Layout>
</SeriesLabels>
</Labels>
</X>
<Y LineThickness="1" TickmarkInterval="10" TickmarkStyle="Smart"
Visible="False">
<Labels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Far"
ItemFormatString="<DATA_VALUE:00.##>" Orientation="Horizontal"
HorizontalAlign="Far" Orientation="Horizontal" VerticalAlign="Center">
</Y>
<Y2 LineThickness="1" TickmarkInterval="10" TickmarkStyle="Smart"
<Labels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near"
<SeriesLabels Font="Verdana, 7pt" FontColor="Gray" FormatString=""
</Y2>
<X2 LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart"
<Labels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Far"
</X2>
<Z LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="False">
ItemFormatString="" Orientation="Horizontal" VerticalAlign="Center"
<SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Far"
Orientation="Horizontal" VerticalAlign="Center">
</Z>
<Z2 LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart"
<SeriesLabels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near"
</Z2>
</Axis>
<Tooltips FormatString="<ITEM_LABEL>: <DATA_VALUE:00.##>" />
</igchart:UltraChart>
</Template>
</ig:ContentTabItem>
</tabs>
</ig:WebTab>
Hello duncanhopewell,
Thank you for posting this question in our community. I attached a sample that reproduces your scenario. Lease review the sample. In order to avoid this error you can handle the UltraChart_Load() event.
Download and review the sample and let me know if you have any further questions with this matter.
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://ko.infragistics.com/support
Were you able to resolve your issue?
For any further assistance with this matter, do not hesitate to contact me.
Thank you for your reply. I viewed your sample and I understand that you are setting the data source each time on postback for the chart control. My question is, why isn't the control maintaining it's ViewState? I set the EnableViewState = true on both the web tab and the chart. My previous use of the AjaxControlToolKit WebTab did indeed maintain the viewstate, saving the trouble of calling back to the database in circumstances I did not need to. As a point of info, it's not just the chart that doesn't maintain viewstate, it's any control, such as a table control.
According to your question you need to set the data source each time. The enableViewState property will save only the last image of the chart it is not saving the data source. The propery that saves the data source of our controls is EnableDataViewState and it is not implemented for this control. You can save the data source in the ViewState or in the session and to rebind each time on post back.
I hope this helps.
Did you have a chance to try this? For any further questions with this matter do not hesitate to contact me.
Hi kfiduk,
Refer to this post according to your question:
http://community.infragistics.com/forums/p/56388/314014.aspx#314014
Thank you for using our community.
Hi Georgi!
I'm experiencing something similar -- I lose my user control instances when posting back from within a WebTab.
I'm updating a page from the UltraWebTab control to the WebTab control. I can stand them up side by side and when I look at the code in the code-behind when I post back, I can see that the references to the user controls contained with the UltraWebTab are alive and instantiated while the user controls within the WebTab are null.
I'm assuming it's a view-state thing that changed from UltraWebTab to WebTab, but setting ViewStateMode = "Enabled" on the WebTab does nothing.
Again, it's not that my user controls within the WebTab are not properly bound, they are completely null. What's going on here?
Thanks!