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
140
DataItem is lost after a postback
posted

Hello,

I want to store an objet in a datatreenode in the property DataItem (or another if I can) and use this value inside the NodeClick event in the server but the value of DataItem is null

Is it possible to store objet like the old UltraTreeView ?

My objet is not a DataRow

This a short sample to reproduice

 <ignav:WebDataTree ID="WebDataTree1" runat="server" Height="300px" Width="200px">
            <AutoPostBackFlags NodeClick="On" />
        </ignav:WebDataTree>

        void WebDataTree1_NodeClick(object sender, Infragistics.Web.UI.NavigationControls.DataTreeNodeClickEventArgs e)
        {
            Guid g = (Guid)e.Node.DataItem;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTreeNode dt = WebDataTree1.Nodes.Add("test");
                dt.DataItem = Guid.NewGuid();
            }
        }

Thank you very much for your help

Regards,

Romain