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

Multiselect values Not available in KendoGrid Create/Update

3 Answers 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shreesh
Top achievements
Rank 1
Shreesh asked on 18 Oct 2014, 07:12 PM
I am using UI for ASP.NET MVC Q2 2014.
In the attached project, I am using editor template "EventEditor". In this, I have 2 dropdown and 1 multiselect.
The dropdown is working correctly, however multiselect is NOT working. I do NOT get values in the kendogrid Update/Create (Insert methof of Events Controller). I just get count and the values in the list are null. I tried using int (for Id) and also string but nothing worked correctly.
I also have used .Data("Serialize") but no help..
Please solve my request at the earliest.

Thanks

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 22 Oct 2014, 06:08 AM
Hi Shreesh,


After inspecting the provided project it appears that there is some invalid configuration in the editor template for the Grid - all editors are strongly type (EditorFor helper is used) and at the same time the "Name" option of the widget is specified which is invalid configuration.

<label> Employee:  </label>  
@(Html.Kendo().DropDownListFor(i => i.Employee)
    .DataValueField("EmployeeId")
    .DataTextField("EmployeeName")
    .BindTo((System.Collections.IEnumerable)ViewBag.EmployeeList)
    .SelectedIndex(0)
    .OptionLabel("Select ...")
)

Also the from the provided information it seems that there is no default value set for the "SelectedCustomers" field which can prevent the MultiSelect from working correctly - could you please set the DefaultValue to empty array and let us know of the result?

Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Shreesh
Top achievements
Rank 1
answered on 22 Oct 2014, 12:04 PM
I am not using strong typing for dropdown, so no issues and working as acceptable..

However with your inputs, I tried to initialize the multiselect, however I still get only count and values are null.
Can you please tell me in the project (erplite.zip) that I have given in my previous post where to initialize the SelectedCustomer list and how to do it...
0
Vladimir Iliev
Telerik team
answered on 23 Oct 2014, 07:30 AM
Hi Shreesh,

From your previous reply I understand that the MultiSelect is showing values, however they are not persisted in the Grid after saving the changes - could you please clarify if this is the case?
Also after the changes suggested in my previous reply it's not clear for us what might be the reason for current behavior - could you pleas provide runable example where the issue is reproduced (you can use static data at the server side and not include dataBase)? This would help us pinpoint the exact reason for this behavior.

Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Shreesh
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Shreesh
Top achievements
Rank 1
Share this question
or