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

[Solved] Getting Dropdownlist selected Value when the dropdown bound using client api

1 Answer 84 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sampath
Top achievements
Rank 1
Sampath asked on 20 Jul 2012, 12:53 PM
Dear Telerik Team,

I have bounded the dropdown like below,

@(Html.Telerik().DropDownListFor(m => m.BOUND_FLG)

.Placeholder(

 

"Select Bound Flag..")

.ClientEvents(events => events

.OnLoad(

 

"Areas.APUIAdmin.CostCodes.loadBoundFlag")

)

)

"Areas.APUIAdmin.CostCodes.loadBoundFlag" - it is my jquery call.

loadBoundFlag:

 

function (e) {

MOL.Web.Base.loadDropdownList(

 

 

'BOUND_FLG', AP_BOUND_FLAG);

 }

My drop down gets populated.

I am getting the dropdown  list values from a .JS file.

var

 

 

 

AP_BOUND_FLAG = [{ "Text": "I - Inbound", "Value:": "I" }, { "Text": "N - Not Applicable", "Value:": "N" }, { "Text": "O - Outbound", "Value:": "O"}];


But when I try get the selected value in controller. I am able to get.

Thanks in advance.

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 25 Jul 2012, 11:01 AM
Hello Sampath,

The array that is bound to the DropDownList should contain fields with names "Text" and "Value". At least in the provide code, the parameter name for "Value" is appended with a colon - "Value:". Removing it should resolve the problem.

Regards,
Daniel
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
ComboBox
Asked by
Sampath
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or