Devexpress Mvc Gridview's PopuEditForm isnt working in vs 13.2

994 views Asked by At

This the devexpress MVC Gridview page, we are trying to run. But Grid's edit/New button Edit mode popup isnt working. Edit mode in line is working but Update and cancel button in Edit mode isnt working. We are using devexpress version 13.2

Please help us if we are missing something:

@model Notes

@Html.DevExpress().GetStyleSheets(
new StyleSheet { ExtensionSuite = ExtensionSuite.Editors },  
new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout },

new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout, Theme =     "Default" },
 new StyleSheet { ExtensionSuite = ExtensionSuite.GridView }
) 

@Html.DevExpress().GetScripts(
new Script { ExtensionSuite = ExtensionSuite.Editors },
new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
new Script { ExtensionSuite = ExtensionSuite.Editors }
)

 <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js" type="text/javascript"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js" type="text/javascript"></script>
    <script src="http://code.jquery.com/jquery-latest.min.js"
    type="text/javascript"></script>

@{
Html.EnableClientValidation();
Html.EnableUnobtrusiveJavaScript();

var grid = Html.DevExpress().GridView(
    settings =>
    {
        settings.Name = "NotesGrid";
        settings.KeyFieldName = "NoteID";
        settings.CallbackRouteValues = new { Controller = "Request", Action = "GetAssociatedNotesByRequestNoGrid" };
        settings.CustomActionRouteValues = new { Controller = "Request", Action = "GetAssociatedNotesByRequestNoGrid" };
        settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "Request", Action = "GetAssociatedNotesByRequestNoGrid" };
        settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "Request", Action = "GetAssociatedNotesByRequestNoGrid" };
        settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "Request", Action = "GetAssociatedNotesByRequestNoGrid" };
        settings.SettingsEditing.Mode = DevExpress.Web.ASPxGridView.GridViewEditingMode.EditForm;
        settings.SettingsBehavior.ConfirmDelete = true;
        settings.SettingsPopup.EditForm.Width = 600;
        settings.Width = Unit.Percentage(100);

        settings.CommandColumn.Visible = true;
        settings.CommandColumn.ShowNewButton = true;
        settings.CommandColumn.ShowDeleteButton = true;
        settings.CommandColumn.ShowEditButton = true;

        settings.Columns.Add("Description");

        settings.Columns.Add("ModifiedOn");

        //settings.PreRender = (sender, e) =>
        //{
        //    ((MVCxGridView)sender).StartEdit(1);
        //};
        settings.CellEditorInitialize = (s, e) =>
        {
            ASPxEdit editor = (ASPxEdit)e.Editor;
            editor.ValidationSettings.Display = Display.Dynamic;
        };
    });

if (ViewData["EditError"] != null)
{
    grid.SetEditErrorText((string)ViewData["EditError"]);
}

}


@grid.Bind(Model).GetHtml()
1

There are 1 answers

0
yashpal On BEST ANSWER

I found answer myself by re-ordering of jquery file. Jquery file should get added before adding devexpress scripts:

@model Notes

<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js" type="text/javascript"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"
type="text/javascript"></script>
@Html.DevExpress().GetStyleSheets(
new StyleSheet { ExtensionSuite = ExtensionSuite.Editors },  
new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout },

new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout, Theme =     "Default" },
 new StyleSheet { ExtensionSuite = ExtensionSuite.GridView }
) 

@Html.DevExpress().GetScripts(
new Script { ExtensionSuite = ExtensionSuite.Editors },
new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
new Script { ExtensionSuite = ExtensionSuite.Editors }
)