This is a migrated thread and some comments may be shown as answers.
LoadContentFrom in Templates
2 Answers 34 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Peter
Top achievements
Rank 1
Peter asked on 14 Feb 2012, 04:54 PM
hi,

For me one of the best things in the MVC controls is LoadContentFrom, as found in the tabstrip, panel bar and window.
It gives me the opportunity to cut up my UI in clean chunks and have a good fine grained integration with my controllers.

In the grid I would love to have the LoadContentFrom as a way to load templates. At the moment I can hack around that like this

@{ Html.Telerik().Grid<FunctieListModel>().Name(string.Format("Functies{0}", Model))
        .DataBinding(db => db.Ajax().Select("FunctieList", "Organisatie", new { idOrganisatie = Model }))
        .Columns(cols =>
        {
            cols.Bound(n => n.Id).Hidden();
            cols.Bound(n => n.Naam).Title("Naam");
        })
                    .Footer(false)
                    .DetailView(dv => dv.ClientTemplate(Html.Telerik().PanelBar().Name("Functie<#= Id #>")
                        .Items(i => i.Add().LoadContentFrom("Functie", "Organisatie", new { idFunctie = "<#= Id #>", idOrganisatie = Model }).Expanded(true)).ToHtmlString()))
                    .Render();
             
}

In the detail view is a panel bar with one expanded panel. Which uses LoadContentFrom to get tot the real content.  
This works but has a little overhead. Also some traces of the panel bar are still visible in the UI. And when the users manages to hit the bar the panel collapses and hides my content.

I would love to be able to work like this:

@{ Html.Telerik().Grid<FunctieListModel>().Name(string.Format("Functies{0}", Model))
        .DataBinding(db => db.Ajax().Select("FunctieList", "Organisatie", new { idOrganisatie = Model }))
        .Columns(cols =>
        {
            cols.Bound(n => n.Id).Hidden();
            cols.Bound(n => n.Naam).Title("Naam");
        })
                    .Footer(false)
                    .DetailView(dv => dv.LoadContentFrom("Functie", "Organisatie", new { idFunctie = "<#= Id #>", idOrganisatie = Model });
             
}

Wouldn't that be cool ?

I am very interested in your opinion. Is there a chance you will implement (something like) this ? Is there a way to do this in the current version without the need of a panel bar ?

all the best

Peter


2 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 17 Feb 2012, 10:49 AM
Hi Peter,

 Thank you for the suggestion - your points have been updated. We will have your feedback in mind when we discuss the future versions of the control.



Regards,
Georgi Tunev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Peter
Top achievements
Rank 1
answered on 18 Feb 2012, 01:42 PM
hi Georgi,

Thanks for picking this up. I'm looking forward to the result.
I would be completely in heaven if you would also do this for the columns template and any other client-templates in the other controls.

Peter
Tags
General Discussions
Asked by
Peter
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Peter
Top achievements
Rank 1
Share this question
or