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
Hello Romain,
I have heard back from the development that the DataItem can be any object and Webdatatree can only save serializable types across postbacks. Since the user can provide any type of data, it would be hard to serialize every type. Hence, this is not supported.
As an alternative, the user can store any string or serializable type as string in the 'Value' field of the node. This 'Value' persists across postbacks and might be useful. Refer to forum post : http://ko.infragistics.com/community/forums/t/29521.aspx
Please let me know if I can provide any further assistance regarding this matter.
Hello Prabha,
Thank you for your response.
Yes, I can use the Value field to store serializable object but I need to manually implement the serialize method
In the previous component, I had nothing to do with the Tag property
I think it is a very important regression
And It is the worst migration of your components, I think I will swith to devexpress
Regards
Hello Romain06,
Thank you for the update.