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

[Solved] TabStrip in Grid PopUp Window and passing parameter from Model

3 Answers 107 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eddie
Top achievements
Rank 1
Eddie asked on 08 Jul 2011, 03:07 PM
Hi All,
I have a grid and onEdit action its opening the record in PopUp Mode. I'm using the EditorTemplate as well.
I have the TabStrip in that template where I want to load the content from partial view.
My Problem is I'm unable to access the properties of Model and hence cannot pass to my action.
Here is the code of my EditorTemplate View.
@model MyModel.BusinessObjects.Product

 @{ Html.Telerik().TabStrip()
        .Name("TabStrip")
        .Items(tabstrip =>
        {
            tabstrip.Add()
                .Text("Details")
                .LoadContentFrom("_GetProductCodes", "Products", new { productId = @Model.Id, productType  = 2});    // Here I cannot access the @Model.Id property
 })
        .SelectedIndex(0)
        .Render();
}

Any idea how can I access the Model Proeprties in PopUp Window ?

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Scott Kuhn
Top achievements
Rank 1
answered on 22 Jan 2012, 05:18 AM
Did you ever solve this or find a work-around?  I'm running into the same thing.
0
Petur Subev
Telerik team
answered on 23 Jan 2012, 09:33 AM
Hi Scott,

Generally speaking you should not have any issues to access the Model properties as long as the model is declared and properly passed to the View. Could you please share a sample which reproduces the problem so we check what causes it?

Kind regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Eddie
Top achievements
Rank 1
answered on 25 Jan 2012, 05:13 PM
Hi Scott,
I think this was a bug in Telerik or may be in MVC EditorTemplate control for using EditorTemplate along with the Telerik Grid that immediately onload or ondocumentReady functions/events you cannot get the handle of the Model properties. It takes a second or more to render and assign values to the properties.  I might be wrong but that never worked for us.
What I have come around is that instead of using the EditorTemplate We used the Telerik Window control to have our own custom window and created a partial view (EditorTemplate) which gets loaded onload event of the window. And the model we passed to the partial view works absolutely fine there. Secondly we also get rid of the LoadContentFrom(..) and assign the contents dynamically by using our own custom ajax call.
If you have any queries please do not hesitate to contact.
Tags
TabStrip
Asked by
Eddie
Top achievements
Rank 1
Answers by
Scott Kuhn
Top achievements
Rank 1
Petur Subev
Telerik team
Eddie
Top achievements
Rank 1
Share this question
or