I tried to get the dropdownlist to show up in the edit event of the grid but it is not showing up?

4 posts, 0 answers
  1. Johnson
    Johnson avatar
    3 posts
    Member since:
    Jul 2012

    Posted 15 Jun 2012 Link to this post

    So may be it has no idea of the container?

    Can you pass to your support team for a quick answer?

     

    @(Html.Kendo().Grid<PGE.MCRM.RDC.Web.ViewModel.TCA.CustomNotionalValueVM>()

        .Name("grid")       

        .Columns(columns =>

        {       

            columns.Bound(p => p.TRADE_KEY).Title("Trade Key").Width(80);

            columns.Bound(p => p.SYS_NAME).Title("PG&E System").Width(120);

           

            columns.Command(command => command.Destroy()).Width(110);

        })

        .ToolBar(toolbar =>

        {

            toolbar.Create();

            toolbar.Save();

        })   

        .Editable(editable => editable.Mode(GridEditMode.InCell))

        .Sortable()

        .Scrollable()

            .Filterable()

         .Events(e => e.Edit("gridEdit"))

        .DataSource(dataSource => dataSource

            .Ajax()       

            .Batch(true)

            .ServerOperation(false)

            .Events(events => events.Error("error_handler"))

            .Model(model => {

                model.Id(p => p.TRADE_KEY);

                model.Field(p => p.TRADE_KEY).Editable(false);        }

                )       

                    .Create(update => update.Action("SaveNotionalValues", "TCA"))

                .Read(read => read.Action("GetNotionalValues", "TCA", new { sysID = "17", userID = "", tradeKey = "" }))

                    .Update(update => update.Action("SaveNotionalValues", "TCA"))

                .Destroy(update => update.Action("DestroyNotionalValues", "TCA"))

     

        )   

     

    //edit event and I check it is calling this function when I click on the new created row second column

    function gridEdit() {

            //handle the grid edit event to get the dropdownlist show up

                    $('<input  id="SYS_NAMEID" name="SYS_NAMEID" required />').appendTo(container).kendoDropDownList({

                    autoBind: false,

                    dataSource: pgeSystemsDataSource,

                    dataTextField: "SYS_NAME",

                    dataValueField: "SYS_NAME",

                    });

                    $('<span class="k-invalid-msg" data-for="SYS_NAME"></span>').appendTo(container); 

                

        }

  2. Johnson
    Johnson avatar
    3 posts
    Member since:
    Jul 2012

    Posted 15 Jun 2012 Link to this post

    I get the dropdownlist to show up but don’t know how to get rid of the original input textbox.

    So now I have one input textbox and one dropdownlist box?

    Any quick help from your support team on this?

     

    function gridEdit() {

            //handle the grid edit event to get the dropdownlist

                    //this._editContainer.removeClass("k-edit-cell");

                    //this._destroyEditable();

     

                    $('<input  id="SYS_NAMEID" name="SYS_NAMEID" required />').appendTo(this._editContainer).kendoDropDownList({

                    autoBind: false,

                    dataSource: pgeSystemsDataSource,

                    dataTextField: "SYS_NAME",

                    dataValueField: "SYS_NAME",

                    });

                    $('<span class="k-invalid-msg" data-for="SYS_NAME"></span>').appendTo(this._editContainer); 

                

        }

  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Johnson
    Johnson avatar
    3 posts
    Member since:
    Jul 2012

    Posted 15 Jun 2012 Link to this post

    I got first dropdownlist coming in.

     

    function gridEdit() {

            //handle the grid edit event to get the dropdownlist

                  

                    this._editContainer.empty();

     

                    $('<input  id="SYS_NAMEID" name="SYS_NAMEID" required />').appendTo(this._editContainer).kendoDropDownList({

                    autoBind: false,

                    dataSource: pgeSystemsDataSource,

                    dataTextField: "SYS_NAME",

                    dataValueField: "SYS_NAME",

                    });

                    $('<span class="k-invalid-msg" data-for="SYS_NAME"></span>').appendTo(this._editContainer); 

                

        }

  5. Yun
    Yun avatar
    2 posts
    Member since:
    Mar 2013

    Posted 12 Apr 2013 Link to this post

    I am having same issue on Chrome

    How to fix??


    Thank u...
Back to Top
UI for ASP.NET MVC is VS 2017 Ready