This is a migrated thread and some comments may be shown as answers.

How to get it work this treeview..

1 Answer 67 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rockey
Top achievements
Rank 1
Rockey asked on 03 Aug 2010, 05:18 AM

Hello friends,

<%= Html.Telerik().TreeView()
       
.Name("TreeView")
       
.HtmlAttributes(new { style = "width: 150px; float: left; margin-bottom: 30px;" })
       
.BindTo(Model.ObnCategoryTextComponent, mappings =>
       
{
            mappings
.For<ObnCategory>(binding => binding
                   
.ItemDataBound((item, category) =>
                   
{
                        item
.Text = category.ObnCategoryName;
                   
})
                   
.Children(category =>category.ObnSubCategoryName));

            mappings
.For<ObnSubCategory>(binding => binding
                   
.ItemDataBound((item, subCategory) =>
                                       
{
                item
.Text = subCategory.ObnSubCategoryName;
     
}));
 
})
%>

Here I have two Table ObnCategory and ObnSubCategory

my plan is to display all ObnCategories in treeveiwe I need to display all SubCategories for that Categories.........But here I am not able to dislay ObnSubCategoryName for Children..

Can anyone help me out..how to display ObnSubCategoryName for each Category..

Here is my ObnCategory table..

has
ObnCategoryId
    obnCategoryName

ObnSubCategory table has

   
ObnSubCategoryId
   
ObnSubCategoryName
   
ObnCategoryId

So ObnCategoryId is there in ObnSubCategory table..

Please can anyone tell me how to display ObnSubCategoryName in Childeren..

Thanks

1 Answer, 1 is accepted

Sort by
0
Rockey
Top achievements
Rank 1
answered on 03 Aug 2010, 03:19 PM
Please anyone has any idea about this?

thanks
Tags
TreeView
Asked by
Rockey
Top achievements
Rank 1
Answers by
Rockey
Top achievements
Rank 1
Share this question
or