Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
665
WebDataTree Template Fields Disappear on Postback
posted

Hello, I'm having a problem with the WebDataTree. It looks like when I use a template and perform a postback, my data is no longer bound. I have confirmed that when a template is not used, the data stays bound. I would suspect that I’m doing something wrong.

Here's a simple sample of what I’m trying in my application. 

The only thing happening in the code behind is in the WebDataTree1_NodeBound event where I assign the node a template.

Anyone see any problems here?

<ig:WebDataTree EnableViewState="true" ID="WebDataTree1" runat="server" 
 OnNodeBound="WebDataTree1_NodeBound" DataSourceID="WebHierarchicalDataSource1" >
 <Templates>
  <ig:ItemTemplate ID="WebDataTree1Template1" runat="server" TemplateID="Participant">
   <Template>
    <%# (Eval("FullName"))%>
   </Template>
  </ig:ItemTemplate>
 </Templates>
 <DataBindings>
  <ig:DataTreeNodeBinding DataMember="sdsParticipant_DefaultView"  />
 </DataBindings>
</ig:WebDataTree>

<ig:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server" >
 <DataViews>
  <ig:DataView ID="sdsParticipant_DefaultView" DataMember="DefaultView" 
   DataSourceID="sdsParticipant" />
 </DataViews>
</ig:WebHierarchicalDataSource>

<asp:SqlDataSource ID="sdsParticipant" runat="server" 
 ConnectionString="<%$ ConnectionStrings:usWorkBaseConnectionString %>"            
 SelectCommand="SELECT [FirstName] + ' ' + [LastName] as FullName, *
  FROM [Participants] WHERE [LastName] = 'Abaray'">
</asp:SqlDataSource>       

<asp:Button Text="Postback" runat="server" />

 

Any help would be much appreciated.