Dropdown kendo select item update another field

2 Answers 97 Views
DropDownList General Discussions
Sorin
Top achievements
Rank 1
Iron
Sorin asked on 22 Feb 2023, 03:38 PM | edited on 22 Feb 2023, 03:46 PM

Hello,

I need help for the following issue:

this is the dropdown list -

                @Html.Kendo().DropDownListFor(m => m.PoLine[nr].ActivityId).DataTextField("Value").DataValueField("Key").DataSource(source =>
           {
               source.Read(read =>
               {
                   read.Action(@MVC.Budget.Budget.ActionNames.GetActivity, MVC.Budget.Name)
                       .Type(HttpVerbs.Post)
                       .Data("function () { return filterSubCategory('" + categoryId.Replace("\\", "\\\\") + "','" + subCategoryId.Replace("\\", "\\\\") + "'," + @current.ActivityId + "," + @nr + "); }");
               })
               .ServerFiltering(true);
           }).Enable(true).AutoBind(false).CascadeFrom(subCategoryId).Events(ev => { ev.Change("function(e){ var item = this.dataItem(); return true; return onchangeDivFromItemText(item,'" + string.Format(idReplace, "activity") + "')}"); }).HtmlAttributes(new { @class = "combo_date", style = "width:170px;" })

and this is the field where I want to be updated - 

@Html.UbiLabelValues(Model.RefMarketList.Where(item => item.Key.HasValue && item.Key.Value == Model.PoLine[nr].MarketId).FirstOrDefault().Value, LabelFor: "MarketName", className: "MarketName")

where UbiLabelValues returns - 

            string s = "<label for='{1}' {1} >{0}</label>";
            s = string.Format(s, text, LabelFor, className);
            return new MvcHtmlString(s);

I want to know how to change ev.Change of dropdown in order to referentiate the field with the new value selcted from dropdown.

2 Answers, 1 is accepted

Sort by
0
Accepted
Sorin
Top achievements
Rank 1
Iron
answered on 27 Feb 2023, 01:58 PM
I've already solved this issue. Anyway, thx for the support.
0
Karina
Telerik team
answered on 27 Feb 2023, 10:52 AM

Hello Sorin,

Thank you for reaching out to us!

I will need to gather a bit more information about this inquiry and I will be able to connect you with the proper product specialist. Can you advise of the following information at your convenience:

- What is the product you use?

Requested end-user information:

- Email address

- First and Last Name

- Company

- Address

- Vat ID (if applicable)


Thank you for your help in providing this information!

 

Regards, Karina

Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DropDownList General Discussions
Asked by
Sorin
Top achievements
Rank 1
Iron
Answers by
Sorin
Top achievements
Rank 1
Iron
Karina
Telerik team
Share this question
or