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

[Solved] TabStrip and Grid server Binding

9 Answers 97 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jawed
Top achievements
Rank 1
jawed asked on 24 Jan 2012, 05:06 PM
Please find attached test project . I am facing problem in telerik grid with in tabstrip.

Its show grid very first time nicely but when try to sort,edit or any operation on grid the grid does not get css and its become main page.
Please see the problem and send solutuon.
Thanks

9 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 24 Jan 2012, 05:43 PM
Hello Jawed,

To make things work you need to configure your Grid to use Ajax binding, since it is loaded from partial view (using the LoadContentFrom method).

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
jawed
Top achievements
Rank 1
answered on 25 Jan 2012, 08:48 AM
When i try with ajax binding then after sorting or editing cancel or any operation on  grid  then data of the  enum field of grid have change .It shows numeric value.
Please see the new test project with ajax binding.

In the previous build 
Any other way to call page without LoadContentFrom that show grid page with in tab there is no any error while any oparation on grid??

Please help

thanks

0
Petur Subev
Telerik team
answered on 26 Jan 2012, 10:07 AM
Hello again Jawed,

This is happening because you are using a display template on your initial load to display the name of the enum, but when the data comes via Ajax (e.g. after sorting) the data is serialized using the value of the enum. I suggest you to use a view model which does not depend on enums.

As for your second question I do not understand what you mean, could you clarify? 


All the best,
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
jawed
Top achievements
Rank 1
answered on 27 Jan 2012, 06:57 AM
Please send a  test project of this solution that support enum data as well as culture.


Thanks
Jawed
0
jawed
Top achievements
Rank 1
answered on 27 Jan 2012, 07:03 AM
My second question was
Do have any idea or solution with server binding becouse I want both soltion server binding and ajax binding .I have already uploaded  my first test project(with server binding) .Please also send solution with server binding.
0
Petur Subev
Telerik team
answered on 27 Jan 2012, 05:51 PM
Hello Jawed,

I have attached a sample project. Basically it is using View Model to properly display the enum property since it is using string instead. There are also few other changes made to your editor template and no display template is needed.
As for the server binding scenario you need to declare your grid in the same View as the TabStrip using the Content method
e.g.
tabstrip.Add()
.Text("General")
.ImageUrl("../../Content/2011.2.712/Common/Icons/Suites/mvc.png")
.Content(() => {
   Html.Telerik().Grid<ElectrumApplication.Models.MarketSecurity>().Name("sda")
       //...
       .Render();
}
);


All the best,
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
jawed
Top achievements
Rank 1
answered on 30 Jan 2012, 07:55 AM
Thanks Petur
Solution is good but there is a problem in this solution is that enum editor templates.
I had written the code for generic for all the enum for singe editor templates but in your solution it is not generic.
See
@model System.Object
@(
    Html.Telerik().DropDownList()
        .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
        .BindTo(new SelectList(Html.EnumSelectList<Object>(Model.GetType()), "Value", "Text"))
)
 This is generic code for all enum type data or you can say for single editor template for all combo.

but in your solution..

@model System.Object
@(
    Html.Telerik().DropDownList()
        .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
            .BindTo(new SelectList(Html.EnumSelectList<Object>(typeof(ElectrumApplication.Models.SecurityType)), "Value", "Text"))
)

this is not generic ,it support only for "Security type" enum data.

So Please help me how can make it generic that support all enum.


As for the Server binding it good for your hints but  in the my project need 
grid within grid  like Master/Detail grid you can see example
http://demos.telerik.com/aspnet-mvc/razor/grid/hierarchyserverside 

so please help can I implement this type of grid within tabsrip.

Thanks.



0
Georgi Tunev
Telerik team
answered on 30 Jan 2012, 04:09 PM
Hello Jawed,

 Please note that providing custom solutions by request is a consulting service and this is out of the scope of our support services. For such type of services, I would recommend our partner Falafel Software. This page provides more information on the subject.

Greetings,
Georgi Tunev
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
jawed
Top achievements
Rank 1
answered on 31 Jan 2012, 12:25 PM
Thanks Petur
Do you have any idea to solve this problem using server binding ??

Thanks
Jawed
Tags
General Discussions
Asked by
jawed
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
jawed
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or