Click here to Skip to main content
14,661,016 members
Rate this:
Please Sign up or sign in to vote.
See more:
<<pre lang="text">pre>I'm using MVC4,Kendo tabstrip in number 3 tabstrip i have. 1#Tab -I have a kendo UI page 2#Tab -One kendo grid with Inline Editing that consists of Checkbox and dropdownlist 3#Tab -Another kendo grid with Inline editing consists of Checkbox and dropdownlist

My first tab strip code is this:


@using (Html.BeginForm("UpdatePublishTariffSetup", "Pradeep"))
{
    <div class="frameRight">
        <input type="submit" class="btn_Green" name="Command" value="Freeze" />
    </div>
    @(Html.Kendo().TabStrip()
          .Name("tabstrip")
          .Events(e => e.Select("tabstrip_select"))
          .Items(tabstrip =>
          {
              tabstrip.Add().Text("Fields")
                  .Selected(true)
                  .Content(@<text>
    <div class="frmWrapper threeCol flexi">
        <ul class="frmFldWrapper">
            <li class="threeCol">
                @Html.LabelFor(p => p.CSCSealCondition)
                @Html.DropDownList("CSCSealCondition", new List<SelectListItem>
                     {
                        new SelectListItem{ Text="Mandatory", Value = "M" }, 
                        new SelectListItem{ Text="Optional", Value = "O" },

                     }) </li>
            <li class="threeCol2"></li>
            <li class="threeCol">
                @Html.LabelFor(p => p.ComingFrom)
                @Html.DropDownList("ComingFrom", new List<SelectListItem>
                     {
                        new SelectListItem{ Text="Mandatory", Value = "M" }, 
                        new SelectListItem{ Text="Optional", Value = "O" },

                     }) </li>
            <li class="threeCol">
                @Html.LabelFor(p => p.GoingTo)
                @Html.DropDownList("GoingTo", new List<SelectListItem>
                     {
                        new SelectListItem{ Text="Mandatory", Value = "M" }, 
                        new SelectListItem{ Text="Optional", Value = "O" },

                     }) </li>
            <li class="threeCol">
                @Html.LabelFor(p => p.ToConnect)
                @Html.DropDownList("ToConnect", new List<SelectListItem>
                     {
                        new SelectListItem{ Text="Mandatory", Value = "M" }, 
                        new SelectListItem{ Text="Optional", Value = "O" },

                     }) </li>
            <li class="threeCol">
                @Html.LabelFor(p => p.DeclLastComm)
                @Html.DropDownList("DeclLastComm", new List<SelectListItem>
                     {
                        new SelectListItem{ Text="Mandatory", Value = "M" }, 
                        new SelectListItem{ Text="Optional", Value = "O" },

                     }) </li>
            <li class="threeCol">
                @Html.LabelFor(p => p.DeclOffHire)
                @Html.DropDownList("DeclOffHire", new List<SelectListItem>
                     {
                        new SelectListItem{ Text="Mandatory", Value = "M" }, 
                        new SelectListItem{ Text="Optional", Value = "O" },

                     }) </li>
            <li class="threeCol">
                @Html.LabelFor(p => p.DeclSale)
                @Html.DropDownList("DeclSale", new List<SelectListItem>
                     {
                        new SelectListItem{ Text="Mandatory", Value = "M" }, 
                        new SelectListItem{ Text="Optional", Value = "O" },

                     }) </li>
        </ul>
    </div>
    </text>);**


My 2ndtab strip code is this:


tabstrip.Add().Text("Activity")
                        .Content(@<text>
    <div class="frmWrapper threeCol flexi">

        @(Html.Kendo().Grid((List<Logstar.Model.SysAdmin.SuperAdmin.Model2>)ViewBag.Activity)
            .Name("GMActivity")
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("ViewDetailsData", "Pradeep"))
                .Model(model => model.Id(m => m.ActivityId))
                .Batch(true)
                .Update(up => up.Action("UpdateTariffActivity", "Pradeep"))
            )
            .Columns(columns =>
            {
                columns.Bound(c => c.ActivityId).Width(200).Column.Visible = false;
                columns.Bound(c => c.ActivityCode).Width(80);
                columns.Bound(m => m.ReqRailVal).ClientTemplate("# if(ReqRailVal == 1) {#" +
                " <input type='checkbox' name='rail' checked='checked' class='DisablePink' disabled='disabled' />" +
                "#} else if(ReqRailVal == 0) {#" +
                "" +
                "#}#")
                .Title("Rail?").Width(80);
                columns.Bound(m => m.ReqPastDateVal).ClientTemplate("# if(ReqPastDateVal == 1) {#" +
                " <input type='checkbox' name='rail' checked='checked' />" +
                "#} else if(ReqPastDateVal == 0) {#" +
                "<input type='checkbox' name='rail'/>" +
                "#}#")
                .Title("Past D&T?").Width(80);
                columns.Bound(m => m.ReqOprVal).ClientTemplate("# if(ReqOprVal == 1) {#" +
                " <input type='checkbox' name='rail' checked='checked' />" +
                "#} else if(ReqOprVal == 0) {#" +
                "<input type='checkbox' name='rail'/>" +
                "#}#")
                .Title("OPR Val?").Width(80);

            })
            .Editable(ed => ed.Mode(GridEditMode.InCell))
            .ToolBar(tb => tb.Save())
            .Sortable()
        )
    </div>
    </text>);


My 3rd tab strip code is this:


tabstrip.Add().Text("Storage")

                              .Content(@<text>
    <div class="frmWrapper threeCol flexi">
        @*@(Html.Kendo().Grid((List<Logstar.Model.SysAdmin.SuperAdmin.Model2>)ViewBag.GMStorage)*@
        @(Html.Kendo().Grid((List<Logstar.Model.SysAdmin.SuperAdmin.GMActivity>)ViewBag.GMStorage)
            .Name("GMActivityStorage")
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("ViewDetailsData", "Pradeep"))
                .Model(model => model.Id(m => m.ActivityId))
                .Batch(true)
                        .Update(up => up.Action("ManageActivityStorage", "Pradeep"))

            )
            .Columns(columns =>
            {
                columns.Bound(c => c.ActivityId).Width(200).Column.Visible = false;
                columns.Bound(c => c.ActivityCode).Width(80);
                columns.Template(m => m.Apply).ClientTemplate("# if(ReqPastDateVal == 1) {#" +
                " <input type='checkbox' name='rail' checked='checked' />" +
                "#} else if(ReqPastDateVal == 0) {#" +
                "<input type='checkbox' name='rail'/>" +
                "#}#")
                .Title("Rail?").Width(80);
                columns.Bound(m => m.StartField).ClientTemplate("# if(ReqPastDateVal == 1) {#" +
                " <input type='checkbox' name='rail' checked='checked' />" +
                "#} else if(ReqPastDateVal == 0) {#" +
                "<input type='checkbox' name='rail'/>" +
                "#}#")
                .Title("StartField?").Width(80);
                columns.Bound(m => m.LongStay).ClientTemplate("# if(ReqOprVal == 1) {#" +
                " <input type='checkbox' name='rail' checked='checked' />" +
                "#} else if(ReqOprVal == 0) {#" +
                "<input type='checkbox' name='rail'/>" +
                "#}#")
                .Title("LongStay?").Width(80);
                columns.Bound(c => c.Per).ClientTemplate("<select class='ddlPer' Text='---Select---' name='ddlPer' style='width:120px'></select>").Width(150);
                columns.Bound(c => c.StartTime).ClientTemplate("<select class='ddlStartTime' name='ddlStartTime' style='width:120px'></select>").Width(80);
                columns.Bound(c => c.SlabType).ClientTemplate("<select class='ddlSlabType' name='ddlSlabType' style='width:120px'></select>").Width(80);
                columns.Bound(c => c.CalcType).ClientTemplate("<select class='ddlCalcType' name='ddlCalcType' style='width:120px'></select>").Width(80);
            })
                .Editable(ed => ed.Mode(GridEditMode.InCell))
                .ToolBar(tb => tb.Save())
            .Sortable()
        )
    </div>
    </text>);


My controller Action Method for Updating grid:


[AcceptVerbs(HttpVerbs.Post)]
        public ActionResult ManageActivityStorage([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<DMGeoActivityStorage> updated)
        {
}


here i use two different models Model1-Is UI kendo page. Model2-Is Common Table to bind all two grids but on inline edit i'm saving it to two different tables.

My issue is on 2nd and 3rd tabstrip when i Click the Save changes button within the grid it's refreshing the grid,controller action is not fired. Where i'm missing ..? pls help me out of this..!!!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100