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

[Solved] Grid with Pop Up does not work inside TabStrip

2 Answers 49 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.
Tai
Top achievements
Rank 1
Tai asked on 13 Sep 2010, 07:31 AM
Hi,
I'm new with using Telerik and I have a problem about Grid inside TabStrip.

1. Content.Master
    <%= Html.Telerik().ScriptRegistrar()
                           .DefaultGroup(group => group
                                                    .Add("jquery-1.4.2.min.js")
                                                    .Add("telerik.common.js")
                                                    .Add("telerik.grid.js")
                                                    .Add("telerik.grid.filtering.js"))
    %>

2. ViewQuotationDetail.aspx
<%= Html.Telerik().TabStrip()
     .Name("Items")
     .Items(items =>
     {
         items.Add()
             .Text("Xây dá»±ng")
             .HtmlAttributes(new { style = "font-weight:bold;vertical-align:top;" })
             .Selected(true)
             .LoadContentFrom("View_XayDung", "QuotationManagement", new{id = Model.QuotationID});        
     })
 %>

3. View_XayDung.ascx
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TTArt.Web.Models.ViewModel.QuotationViewModel>" %>
        
        <%= Html.Telerik().Grid<TTArt.Web.Models.ViewModel.ItemViewModel>()
                                .Name("QuotationManagement")
                                .DataKeys(keys =>
                                {
                                    keys.Add(p => p.ItemID);
                                })
                                            .HtmlAttributes(new { style = "font-size:0.8em;" })
                .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image).ImageHtmlAttributes(new { style = "margin-left:0" }))                      
                    .DataBinding(dataBinding =>
                    {
                        dataBinding.Ajax()
                            .Select("IndexAjax_XayDung", "QuotationManagement", new { id = Model.QuotationID })
                            .Insert("InsertAjax", "QuotationManagement")
                            .Update("UpdateAjax", "QuotationManagement")
                            .Delete("DeleteAjax", "QuotationManagement");
                    })
        .Columns(columns =>
            {
                columns.Bound(item => item.ItemName).Width(80).Title("Tên").HeaderHtmlAttributes(new { style = "text-align:left; font-weight:bold;" });                
                columns.Bound(item => item.Description).Width(120).HeaderHtmlAttributes(new { style = "text-align:left; font-weight:bold;" });
               
                columns.Command(commands =>
                {
                    commands.Edit().ButtonType(GridButtonType.Image).HtmlAttributes(new { style = "text-align:center; width:20px; padding-left:-50px;" });
                    commands.Delete().ButtonType(GridButtonType.Image).HtmlAttributes(new { style = "text-align:center;" });
                }).Width(185).Title("Thao tác").HeaderHtmlAttributes(new { style = "text-align:left; font-weight:bold;" });
            }
            )
        .Editable(edit => edit.Mode(GridEditMode.PopUp))
                    .RowAction(row =>
                    {
                        if (row.Index % 2 == 0)
                        {
                            row.HtmlAttributes["style"] = "background:#F0F0F0;";
                        }
                    })

        .Pageable()
        .Scrollable()
        .Sortable()
        %>

My problem is when I click Add button on the Grid, it does not show Insert Pop Up dialog but shows a new page without any css. I try to change GridEditMode = InLine (or InForm), the problem still occurs. I wonder what thing I miss or anything is wrong in my codes.

I very appciate with your help.

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 13 Sep 2010, 09:57 AM
Hi Tai,

I believe that the scripts required for grid editing is not loaded (because of the Ajax rendering). I noticed that you are registering telerik.grid.js and telerik.grid.filtering.js file. You should also minimum register telerik.grid.editing.js file. For more concrete information, which files you should register check this online help article.

Kind regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tai
Top achievements
Rank 1
answered on 14 Sep 2010, 03:19 PM
Thanks Admin,

I've just resolved my problem. :-)
Tags
TabStrip
Asked by
Tai
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Tai
Top achievements
Rank 1
Share this question
or