Hey guys, I have an UltraWebTree that is not working as expected. It has 4 levels deep, and after the roor it starts with 2 leaves. One of them is never selected. After the user clicks on it, it will highlight for less than a sec, refresh the page and then highlight the previous leave, without firing the NodeSelectionChanged event.
I just don't have a clue, could somebody help me please?
HTML markup:
<ignav:UltraWebTree id="UltraWebTree1" runat="server" DisabledClass="" NodeEditClass="" TargetFrame="" TargetUrl="" OnNodeSelectionChanged="UltraWebTree1_NodeSelectionChanged" > <Levels> <ignav:Level Index="0" LevelCheckBoxes="False"></ignav:Level> <ignav:Level Index="1"></ignav:Level> <ignav:Level Index="2"></ignav:Level> <ignav:Level Index="3"></ignav:Level> </Levels> </ignav:UltraWebTree>
This is how I populate the WebTree
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { PopulateTreeView(); } } public void PopulateTreeView() { DataTable facClassTable = FacClassBLL.getList(); DataTable catGroupTable = CatGroupBLL.getList(); DataTable basicCatTable = BasicCatBLL.getList(); DataTable facAnalysisCat = FacAnalysisCatBLL.getList(); DataSet dataSet = new DataSet("CatCodes"); facClassTable.TableName = CacheKeys.FacClassList.ToString(); catGroupTable.TableName = CacheKeys.CatGroupList.ToString(); basicCatTable.TableName = CacheKeys.BasicCatList.ToString(); facAnalysisCat.TableName = CacheKeys.FacAnalysisCatList.ToString(); dataSet.Tables.Add(facClassTable); dataSet.Tables.Add(catGroupTable); dataSet.Tables.Add(basicCatTable); dataSet.Tables.Add(facAnalysisCat); dataSet.Relations.Add("FacClass_CatGroup", dataSet.Tables[CacheKeys.FacClassList.ToString()].Columns["FacClassSeq"], dataSet.Tables[CacheKeys.CatGroupList.ToString()].Columns["FacClassSeq"]); dataSet.Relations.Add("CatGroup_BasicCat", dataSet.Tables[CacheKeys.CatGroupList.ToString()].Columns["CatGroupSeq"], dataSet.Tables[CacheKeys.BasicCatList.ToString()].Columns["CatGroupSeq"]); dataSet.Relations.Add("BasicCat_FacAnalysisCat", dataSet.Tables[CacheKeys.BasicCatList.ToString()].Columns["BasicCatSeq"], dataSet.Tables[CacheKeys.FacAnalysisCatList.ToString()].Columns["BasicCatSeq"]); UltraWebTree1.DataSource = dataSet; UltraWebTree1.Levels[0].LevelKeyField = "FacClassSeq"; UltraWebTree1.Levels[1].LevelKeyField = "CatGroupSeq"; UltraWebTree1.Levels[2].LevelKeyField = "BasicCatSeq"; UltraWebTree1.Levels[3].LevelKeyField = "FacAnalysisCatSeq"; UltraWebTree1.Levels[0].RelationName = "FacClass_CatGroup"; UltraWebTree1.Levels[1].RelationName = "CatGroup_BasicCat"; UltraWebTree1.Levels[2].RelationName = "BasicCat_FacAnalysisCat"; UltraWebTree1.Levels[0].ColumnName = "FacClassTitle"; UltraWebTree1.Levels[1].ColumnName = "CatGroupTitle"; UltraWebTree1.Levels[2].ColumnName = "BasicCatTitle"; UltraWebTree1.Levels[3].ColumnName = "FacAnalysisCatTitle"; UltraWebTree1.DataMember = CacheKeys.FacClassList.ToString(); UltraWebTree1.DataBind(); }
Any help would be greatly appreciated, thanks in advance !!!!
Ulises
I've found through experimentation that the order of the code will affect whether the event wireup occurs. When I specify the ClientSideEvents property at the end of the C# (i.e. server-side) code, the JavaScript (i.e. client-side) code works properly. When I specify the ClientSideEvents near the constructor in the C# code, the JavaScript does not fire.
Hi,
Thanks for the reply. I did like that,when a node is added,it doesn't scrolls up but when I double click on node to edit text,then it automatically scrolls to node which I selected before adding new node and when I scroll down,it shows the node in Editing mode.I need when i double click on node for editing,it should not be scrolls to any other node. I appreciate your time you spent on me. have you seen the mobrown1 reply. when I try to use his example, I m unable to find ScrollPosition.Value.Please reply.
Thanks & Regards,
Mukesh
I was investigating a differnet issue and came across a slightly better fix for the issue of scrollTop not being set properly.
This was my resolve...
In the ComponentsTreeView_BeforeNodeSelectionChange function on the client I had alreadt added the following
ele.value = tree.scrollTop;
Now in the class file in the Page_Load I added the following
{
// if the page is being loaded for the first time
// SOME CODE
else
// This sets the controls Scroll position and is actually sent to the client. This resolved my bug and I took out the window.setTimeout I was using before
}
If you have questions let me know
same here too, thks for sharing!
Paulo Pereira, Portugal
imwalker said: hooking the following code into the client side event AfterNodeSelectionChange fixed the problem for me: function UltraWebTree_AfterNodeSelectionChange(treeId, nodeId){var selectedNode = igtree_getNodeById(nodeId); selectedNode.setText(selectedNode.getText()); }
hooking the following code into the client side event AfterNodeSelectionChange fixed the problem for me:
function UltraWebTree_AfterNodeSelectionChange(treeId, nodeId){
var selectedNode = igtree_getNodeById(nodeId);
selectedNode.setText(selectedNode.getText());
This fixed my problem too !!
Thanks for sharing !!!!