This is a migrated thread and some comments may be shown as answers.

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

3 Answers 150 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Johnson
Top achievements
Rank 1
Johnson asked on 15 Jun 2012, 01:45 PM

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); 

            

    }

3 Answers, 1 is accepted

Sort by
0
Johnson
Top achievements
Rank 1
answered on 15 Jun 2012, 01:45 PM

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); 

            

    }

0
Johnson
Top achievements
Rank 1
answered on 15 Jun 2012, 01:46 PM

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); 

            

    }

0
Yun
Top achievements
Rank 1
answered on 12 Apr 2013, 09:21 AM
I am having same issue on Chrome

How to fix??


Thank u...
Tags
DropDownList
Asked by
Johnson
Top achievements
Rank 1
Answers by
Johnson
Top achievements
Rank 1
Yun
Top achievements
Rank 1
Share this question
or