Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi am using dynamic in my project while editing and adding node am getting error..
"These columns don't currently have unique values."

here is my page load code

protected void Page_Load(object sender, EventArgs e)
   {
       {
           verticalSplitterTreeAndInput.LeftDivId = divTree.ClientID;
           verticalSplitterTreeAndInput.RightDivId = divInput.ClientID;

           BidTreeBLL btBLL = new BidTreeBLL();

           dt = btBLL.GetBidTreeFromSessionDatatable();

           GridView1.DataSource = dt;
          GridView1.DataBind();

          tvBidTree.DataFieldID = "btNodeID";//
          tvBidTree.DataFieldParentID = "btParentNodeID";//

          tvBidTree.DataTextField = "btName";//
          tvBidTree.DataValueField = "btNodeID";//

          tvBidTree.DataSource = dt;//
          tvBidTree.DataBind(); //to this line am getting error

       }
       tvBidTree.ExpandAllNodes();//
       tvBidTree.FindNodeByValue("0").Expanded = true; //commented on 29/06


       if (!IsPostBack)
       {
           ClearControls();
           ClearDynamicControls();
           tvBidTree.AllowNodeEditing = true;

           tvBidTree.FindNodeByValue("0").AllowEdit = false; //commented on 29/06



       }

       ScriptManager.RegisterStartupScript(Page, typeof(Page), "KetMessageDivAnimation", "messageDivAnimation('" + SessionManager.JsControlHideSeconds + "');", true);
       //ScriptManager.RegisterStartupScript(Page, typeof(Page), "resetWBSTreeDiv", "resetWBSTreeDiv();", true);
   }



please any one help me to solve this..thank you
Posted
Updated 1-Aug-18 21:36pm

Check if any value for btNodeID is present more than once in the datatable dt.

Your nodeId's should be unique and it sounds like that your code is trying to assign already used nodeId once again when binding to treeview.
 
Share this answer
 
Comments
ythisbug 4-Jul-12 1:24am    
thanks i will check
ythisbug 4-Jul-12 1:52am    
your rite its assigning already used nodeid once again..can u suggest me again wat have to do
Sandeep Mewara 4-Jul-12 15:29pm    
Just makes sure you have unique values of nodeid!

Use primary key as the node id reference, that will provide the uniqueness.
ythisbug 5-Jul-12 2:13am    
ok thanks..in my table btID is pmkey.
Sandeep Mewara 5-Jul-12 2:24am    
Welcome.
Quote:
Check for the casesentivie property in the datatable.if parent table having duplicate values then it will throw the exception 'These columns don't currently have unique values'.
BY default datatable will ignore the casesensitivity and read as 'A' and 'a' are same.
 
Share this answer
 
Comments
Richard Deeming 3-Aug-18 14:11pm    
SIX YEARS too late, and if you read the comments to solution 1, the question has already been solved.

Stick to answering recent questions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900