Hello,
I'm trying to integrate RadToolTip with RadTreeView, The user can choose to enter a new column name in the tooltip and on a button click the tool tip, the treeView node name would be updated. I'm using a UserControl to display the controls in the tool tip.
The button click event on the tooltip user control calls an UpdateNodeName method on the client side, which does the update on the nodename...I've used treeview.trackChanges() and commitChanges(), but the changes are lost on postback.
protected void btnAddColumn_Click(object sender, EventArgs e) |
{ |
string sType = NodeName.Substring(NodeName.IndexOf('(') + 1, NodeName.IndexOf(',') - (NodeName.IndexOf('(') + 1)); |
NodeName = txtColumnName.Text + "(" + sType + "," + txtLength.Text + ")"; |
string strScript = string.Empty; |
strScript += "UpdateNodeName('" + NodeID + "','" + NodeName + "','" + txtLength.Text + "','"+BaseID+"');"; |
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "WebUserControlScript", "CloseActiveToolTip();" + strScript, true); |
} |
function UpdateNodeName(nodeID, nodeName, attLength, selTreeID) { |
var SelectedTree = $find(selTreeID); |
if (SelectedTree != null) { |
SelectedTree.trackChanges(); |
var RootNode = SelectedTree.get_nodes().getNode(0); |
if (RootNode != null) { |
var Node = FindNodeByNodeID(RootNode, nodeID); |
if (Node != null) { |
//Node.get_treeView().trackChanges(); |
Node.set_text(nodeName); |
SelectedTree.commitChanges(); |
Node.get_treeView().trackChanges(); |
Node.get_attributes().setAttribute("attlength", attLength); |
Node.get_treeView().commitChanges(); |
} |
//Node.get_treeView().commitChanges(); |
} |
} |
} |
I would appreciate any help with this problem,
Thank you,
Phani