public ActionResult dynamicMasterDetailsGirdAjax(GridModifyViewModel model)
        {
            //string demostr = @"<script type='text/javascript' language='javascript'> $(document).ready(function () { //do something... });</script>";

            //string str = @"<script type='text/javascript' language='javascript'> $(document).ready(function () { alert('Hello! I am coming from server. :) '); $('#grid').html('Hello! man...'); });</script>";

            var kendoUIGridScript = @"<script type='text/javascript' language='javascript'> $(document).ready(function () { $('#grid').kendoGrid({dataSource:{transport:{read:'/Home/CategoryRead'},schema:{model:{fields:{CategoryId:{type:'number' },Name:{type:'string' }}}},pageSize:10,serverPaging:false,serverFiltering: false,serverSorting:false},height:250,filterable:true,groupable:true,sortable:true,pageable:{refresh:true,pageSizes:true},columns:[{field:'CategoryId',title:'Category ID',width:50,filterable:false},{field:'Name',title:'Category Name',width:250}]});});</script>";

            var str1 = @"<script type='text/javascript' language='javascript'> $(document).ready(function () { $('#grid').kendoGrid({dataSource:{transport:{read:{url: '/KendoUI/DadMasterRead',data:GetFilterModel}},schema:{model:{fields:{Ok_ModelId:{type:'number'},Ok_Name:{type:'string'},CommittedAmount:{type:'number'},DisbursedAmount:{type:'number'},ExpendedAmount:{type:'number'},A_ModelId:{type:'number'},B_ModelId:{type:'number'},C_ModelId:{type:'number'},D_ModelId:{type:'number'},E_ModelId:{type:'number'}}}},aggregate:[{field:'CommittedAmount',aggregate:'sum'},{field:'DisbursedAmount',aggregate:'sum'},{field:'ExpendedAmount',aggregate:'sum'}],pageSize:10,serverPaging: false,serverFiltering: false,serverSorting:false},filterable:true,groupable:true,sortable:true,pageable:{refresh:true,pageSizes:true},detailTemplate:kendo.template($('#detailOneTemplate').html()),detailInit: detailOneInit,detailExpand:function(){$('#grid tbody .detailOne thead').hide();},columns:[{field:'Ok_ModelId',title:'Ok_ModelId',hidden:true,filterable:false},{field:'Ok_Name',title:'Funding Source/Funding Agency/Project',footerTemplate:'Grand Total:',width:250},{field:'CommittedAmount',title:'Committed',format:'{0:n}',footerTemplate:'#= sum #',filterable:false,sortable: false, width: 150 },{ field:'DisbursedAmount', title: 'Disbursed', format: '{0:n}', footerTemplate: '#= sum #', filterable: false, sortable: false, width: 150 },{ field: 'ExpendedAmount', title: 'Expended', format: '{0:n}', footerTemplate: '#= sum #', filterable: false, sortable: false, width: 150 },{ field: 'A_ModelId', title: 'A_ModelId', hidden: true, filterable: false },{ field: 'B_ModelId', title: 'B_ModelId', hidden: true, filterable: false },{ field: 'C_ModelId', title: 'C_ModelId', hidden: true, filterable: false },{ field: 'D_ModelId', title: 'D_ModelId', hidden: true, filterable: false },{ field: 'E_ModelId', title: 'E_ModelId', hidden: true, filterable: false }]});function detailOneInit(e) {var detailRow = e.detailRow;var masterId = e.data.Ok_ModelId;detailRow.find('.detailOne').kendoGrid({dataSource: {transport: {read: {url: '/KendoUI/DadDetailOneRead/' + masterId}},serverPaging: false,serverSorting: false,serverFiltering: false},scrollable: false,sortable: false,filterable: false,pageable: false,detailTemplate: kendo.template($('#detailTwoTemplate').html()),detailInit: detailTwoInit,detailExpand: function () {$('#grid tbody .detailTwo thead').hide();},columns: [{ field: 'Ok_ModelId', title: '', hidden: true },{ field: 'Ok_Name', title: '', width: 200 },{ field: 'CommittedAmount', title: '', format: '{0:n}', width: 130 },{ field: 'DibursedAmount', title: '', format: '{0:n}', width: 135 },{ field: 'ExpendedAmount', title: '', format: '{0:n}', width: 135 },{ field: 'A_ModelId', title: '', hidden: true },{ field: 'B_ModelId', title: '', hidden: true },{ field: 'C_ModelId', title: '', hidden: true },{ field: 'D_ModelId', title: '', hidden: true },{ field: 'E_ModelId', title: '', hidden: true }]});}function detailTwoInit(e) {var detailRow = e.detailRow;var detailId = e.data.Ok_ModelId;detailRow.find('.detailTwo').kendoGrid({dataSource: {transport: {read: {url: '/KendoUI/DadDetailTwoRead/' + detailId}},serverPaging: false,serverSorting: false,serverFiltering: false},scrollable: false,sortable: false,filterable: false,pageable: false,columns: [{ field: 'Ok_ModelId', title: '', hidden: true },{ field: 'Ok_Name', title: '', template: " + "\"<a href='/Home/Project/#= Ok_ModelId #' class='lnkProjectName'>#= Ok_Name #</a>" + "\", width: 222 },{ field: 'CommittedAmount', title: '', format: '{0:n}', width: 150 },{ field: 'DisbursedAmount', title: '', format: '{0:n}', width: 150 },{ field: 'ExpendedAmount', title: '', format:'{0:n}', width: 150 },{ field: 'A_ModelId', title: '', hidden: true },{ field: 'B_ModelId', title: '', hidden: true },{ field: 'C_ModelId', title: '', hidden: true },{ field: 'D_ModelId', title: '', hidden: true },{ field: 'E_ModelId', title: '', hidden: true }]});}function GetFilterModel() {var filterModel = {};filterModel.FundSource = 'FundSource';filterModel.FundAgency = 'FundAgency';filterModel.Project = 'Project';filterModel.Sector = 'Sector';filterModel.ProvinceOrArea = 'ProvinceOrArea';filterModel.DistrictOrAgency = 'DistrictOrAgency';filterModel.ReferenceNumber = 'ReferenceNumber';filterModel.FiscalYear = 'FiscalYear';return filterModel;}});</script>";

            string x = @"<document.write(""<SCR""+""IPT TYPE=""'text/javascript' SRC='""+""http""+(window.location.protocol.indexOf('https:')==0?'s':'')+""://""+gDomain+""/""+gDcsId+""/wtid.js""+""'><\/SCR""+""IPT>"");";

            string rstr = GenerateScript();

            //return Content(str);
            //return Content(kendoUIGridScript);
            //return Content(str1);
            return Content(rstr);
        }
        public ActionResult ModifyDialog(GridModifyViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    return Content(Boolean.TrueString);
                }

                return Content("Please review your form.");
            }
            catch (Exception ex)
            {
                return Content("Error Occured!");
            }
        }
        public ActionResult dynamicGirdAjax(GridModifyViewModel model)
        {
            //string demostr = @"<script type='text/javascript' language='javascript'> $(document).ready(function () { //do something... });</script>";

            //string str = @"<script type='text/javascript' language='javascript'> $(document).ready(function () { alert('Hello! I am coming from server. :) '); $('#grid').html('Hello! man...'); });</script>";

            var kendoUIGridScript = @"<script type='text/javascript' language='javascript'> $(document).ready(function () { $('#grid').kendoGrid({dataSource:{transport:{read:'/Home/CategoryRead'},schema:{model:{fields:{CategoryId:{type:'number' },Name:{type:'string' }}}},pageSize:10,serverPaging:false,serverFiltering: false,serverSorting:false},height:250,filterable:true,groupable:true,sortable:true,pageable:{refresh:true,pageSizes:true},columns:[{field:'CategoryId',title:'Category ID',width:50,filterable:false},{field:'Name',title:'Category Name',width:250}]});});</script>";

            //return Content(str);
            return Content(kendoUIGridScript);
        }