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

Display PanelBar items from a Data Context

1 Answer 119 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Annie
Top achievements
Rank 1
Annie asked on 05 Mar 2013, 01:47 PM

I'm new to Telerik and Kendo UI. We have a commercial license.
Please can you point me to a Kendo sample project for PanelBar that displays data from a Data context (using EF). Is it possible to do inline editing in a Panel Bar like in a Grid (KendoGridMvcCodeFirst sample project)?

Annie

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 07 Mar 2013, 03:08 PM
Hello Annie,

I am afraid we do not have such demo.

Basically you should use the following configuration to bind your PanelBar to model (just like in the old extensions demo);

e.g.

@( Html.Kendo().PanelBar()
        .Name("PanelBar")        
        .BindTo(Model, mappings =>
        {
               mappings.For<Category>(binding => binding
                    .ItemDataBound((item, category) =>
                    {
                        item.Text = category.CategoryName;
                    })
                    .Children(category => category.Products));
               mappings.For<Product>(binding => binding
                    .ItemDataBound((item, product) =>
                    {
                        item.Text = product.ProductName;
                    }));
        })
)


where Model is a collection property from your DB context ( in the example above the Category table from the NorthWind).

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
PanelBar
Asked by
Annie
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or