Loading view in Kendo Custom window

2 posts, 1 answers
  1. Jack
    Jack avatar
    67 posts
    Member since:
    Jul 2010

    Posted 29 Aug 2013 Link to this post

    Hi to all,
    I am doing crud operation by using Kendo Grid and using default window opening.

    I searched a lot for custom window but didn't find the good example.

    what i wants is that on Add and Edit  i wants to open my own form in Kendo window
    i.e create.cshtml and Edit.cshtml .

    I used lot of examples of kendo window but there were lot of problem sometimes
     window not opening sometime form design changing when clicking again and again.

    Please guide me what to do
    or if possible provide me sample where cutom window can be open on Add and edit
    and i can load my forms inside that.

    Thanks
  2. Answer
    Jack
    Jack avatar
    67 posts
    Member since:
    Jul 2010

    Posted 29 Aug 2013 Link to this post

    Ok  i got it.My window has been opened.
    Let me explain here so that it helps another person

    Firstly we have to inatialize th window
     
    @(Html.Kendo().Window()
                          .Name("window")
                          .Title("Add User")
                          .Content("loading...")
                         .LoadContentFrom("Create","ProductKendo")
                          .Modal(true)
                          .Width(550)          
                          .Height(300)          
                          .Draggable()
                          .Visible(false)
                         )
    <button id="btnWindowKendo" value="OpenWindow"></button>
    Let me clarify .LoadContentFrom-   i am passing my Controller name along with action name.In the action Create i am simply calling
    my View.In another words i am loading view in custom window. 

    After that
     <script>
                        $(document).ready(function () {
                            var window = $("#window").data("kendoWindow");

                            $("#btnWindowKendo").click(function (e) {
                                window.center();
                                window.open();
                            });
                           
                        });

    </script>
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top