Hallo, I want to generate my treeview base on the data in my table, for example i have a table TreeStructure that contain
ID -> auto_inc
PARENT_ID -> int
NAME -> character
ID is the primary key, PARENT_ID contains ID of it's parent and NAME is the text I want to display
I want to know is there any way i can generate this data into structured treeview automatically? because before this I do it manually with recursive.
Data Sample ( ID / PARENT_ID / NAME )
1 / 0 / IT , 2 / 0 / SUPPORT , 3 / 0 / SALES
4 / 1 / DEVELOPER , 4 / 1 / NETWORK , 5 / 2 / EDP
tree result :
- IT
---- DEVELOPER
---- NETWORK
- SUPPORT
----EDP
- HRD
thx before :)
Haloo Rumen,
I've tried version 8.2 and the DataItem works fine, I think it really is problems for version 7.2
hmm maybe, i'll post it at the support tomorrow, rumen thx for your support, i hope you're not bored helping me again some other time :)
Well, I really do not know, I am running this again and again and it is working for me. Could this be a version thing? I am trying with 8.1 release. In this case, maybe you can send the same solution to Developer Support and they can probably verify this and provide some suggestions.
Hallo Rumen,
About the code you gave me regarding to DataItem, I have try it exactly what you told me, and the result is the same
DataRow row = e.Node.DataItem as DataRow;
it still returns null, maybe there are some property in UltraWebTree that must be set?below this is a definition of my webtree
<ignav:UltraWebTree ID="tree" runat="server" Font-Names="verdana" Font-Size="8pt" DataKeyOnClient="true" AllowDrag="True" AllowDrop="True" Cursor="Hand" Editable="True" ExpandAnimation="None" InitialExpandDepth="1" WebTreeTarget="ClassicTree" DefaultImage="./img/ig_treeXPFolderClosed.GIF" DefaultSelectedImage="./img/ig_treeXPFolderOpen.gif" HiliteClass="" HoverClass="" Indentation="20" OnNodeAdded="Tree_NodeAdded" OnNodeBound="Tree_NodeBound" OnDataBound="Tree_DataBound" > <ClientSideEvents BeforeNodeUpdate="BeforeNodeUpdate" EditKeyUp="EditKeyUp" EditKeyDown="EditKeyDown" /> <Images> <RootNodeImage Url="./img/MyComputer.gif" /> <DefaultImage Url="./img/ig_treeXPFolderClosed.GIF" /> <SelectedImage Url="./img/ig_treeXPFolderOpen.gif" /> </Images> <NodeEditStyle Font-Names="Verdana" Font-Size="7pt" Height="100px" Cursor="Default"> <Margin Bottom="0px" Left="0px" /> </NodeEditStyle> </ignav:UltraWebTree>
Hello,
Yes, unfortunately I was able to reproduce both client-side problems - returning False from the BeforeNodeUpdate handler works fine initially and the old text is restored, however the javascript error does occur on subsequent click. There might be a workaround for that, where you handle the After event and if the new text is something you do no like, you can use the client-side node setText method to set the text of the node to the old one.
I also was able to reproduce the "\" backslash node-editing problem. For this one I was not able to find a workaround unofrtunately.
I believe that in this case, the best way is to contact directly our official Developer Support department via this link and report both issues
http://es.infragistics.com/gethelp/default.aspx
If this is really a bug (like you and I think), it will be logged with a status number number and you will be able to track its status, or if we are lucky, our Developer Support folks will know what is going on and propose a working solution.