RadTreeView Issue

2 posts, 0 answers
  1. Meghna
    Meghna avatar
    37 posts
    Member since:
    Jun 2008

    Posted 27 Apr 2009 Link to this post

    While binding data to RadTreeView I am getting an error 
    "These columns don't currently have unique values."

    Below is the dataset which I am binding to RadTree

    ParentID    ChildID    Label    Visible    Type
    NULL             1 Category true Category
    NULL 2 Brand true Brand
    NULL 3 SubBrand1 true SubBrand1
    NULL 4 SubBrand2 true SubBrand2
    1 1_52 1_Consumer false Category
    1 1_53 1_Business false Category
    1 1_54 1_Total false Category
    1 1_72 1_Sprint false Category
    1 1_73 1_Nextel false Category
    1 1_189 1_SprintNextel true Category
    1 1_190 1_ATTCingular true Category
    1 1_191 1_ATT true Category
    1 1_192 1_Cingular true Category
    1 1_193 1_TMobile true Category
    1 1_194 1_Verizon true Category
    2 2_137 2_Sprint false Brand
    2 2_138 2_Nextel true Brand
    2 2_224 2_Business true Brand
    2 2_225 2_Consumer true Brand
    2 2_226 2_Total false Brand
    3 3_246 3_Wireless true SubBrand 1
    4 4_194 4_Total true SubBrand 2
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 29 Apr 2009 Link to this post

    Hi Meghna,

    I couldn't reproduce this issue using the following code:

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            DataTable data = new DataTable();
            data.Columns.Add("ParentID");
            data.Columns.Add("ChildID");
            data.Columns.Add("Label");
            data.Columns.Add("Visible");
            data.Columns.Add("Type");

            data.Rows.Add(null, "1", "Category", "true", "Category");
            data.Rows.Add(null, "2", "Brand", "true", "Brand");
            data.Rows.Add(null, "3", "SubBrand1", "true", "SubBrand1");
            data.Rows.Add(null, "4", "SubBrand2", "true", "SubBrand2");
            data.Rows.Add("1", "1_52", "1_Consumer", "false", "Category");
            data.Rows.Add("1", "1_53", "1_Business", "false", "Category");
            data.Rows.Add("1", "1_54", "1_Total", "false", "Category");
            data.Rows.Add("1", "1_72", "1_Sprint", "false", "Category");
            data.Rows.Add("1", "1_73", "1_Nextel", "false", "Category");
            data.Rows.Add("1", "1_189", "1_SprintNextel", "true", "Category");
            data.Rows.Add("1", "1_190", "1_ATTCingular", "true", "Category");
            data.Rows.Add("1", "1_191", "1_ATT", "true", "Category");
            data.Rows.Add("1", "1_192", "1_Cingular", "true", "Category");
            data.Rows.Add("1", "1_193", "1_TMobile", "true", "Category");
            data.Rows.Add("1", "1_194", "1_Verizon", "true", "Category");
            data.Rows.Add("2", "2_137", "2_Sprint", "false", "Brand");
            data.Rows.Add("2", "2_138", "2_Nextel", "true", "Brand");
            data.Rows.Add("2", "2_224", "2_Business", "true", "Brand");
            data.Rows.Add("2", "2_225", "2_Consumer", "true", "Brand");
            data.Rows.Add("2", "2_226", "2_Total", "false", "Brand");
            data.Rows.Add("3", "3_246", "3_Wireless", "true", "SubBrand");
            data.Rows.Add("4", "4_194", "4_Total", "true", "SubBrand");

            RadTreeView1.DataFieldID = "ChildID";
            RadTreeView1.DataFieldParentID = "ParentID";
            RadTreeView1.DataTextField = "Label";
            RadTreeView1.DataSource = data;
            RadTreeView1.DataBind();
        }

    What is different in your case?

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top