Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET4.0
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 3-Jul-12 20:06pm
ythisbug2.1K

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
ythisbug at 4-Jul-12 1:24am
   
thanks i will check
ythisbug at 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 at 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 at 5-Jul-12 2:13am
   
ok thanks..in my table btID is pmkey.
Sandeep Mewara at 5-Jul-12 2:24am
   
Welcome.

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



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 4 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100