Click here to Skip to main content
11,709,366 members (40,076 online)
Rate this: bad
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;
          tvBidTree.DataFieldID = "btNodeID";//
          tvBidTree.DataFieldParentID = "btParentNodeID";//

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

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

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

       if (!IsPostBack)
           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 19:06pm

1 solution

Rate this: bad
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.
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 my table btID is pmkey.
Sandeep Mewara at 5-Jul-12 2:24am

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 580
1 OriginalGriff 250
2 Maciej Los 225
3 Peter Leow 219
4 Mika Wendelius 160
0 OriginalGriff 9,428
1 Sergey Alexandrovich Kryukov 9,027
2 CPallini 5,189
3 Maciej Los 4,991
4 Mika Wendelius 3,856

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 4 Jul 2012
Copyright © CodeProject, 1999-2015
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