How to access values outside of grid during grid update

2 posts, 1 answers
  1. Jason
    Jason avatar
    2 posts
    Member since:
    Dec 2015

    Posted 16 Feb Link to this post

    I am at a disadvantage because not only am I new to Kendo UI, but I am new to MVC as well.

    Using the Save method inside Kendo UI Grid, I ALSO need to access a selected value from a Kendo Drop Down List.

    For the life of me, I cannot figure out how to access the value.

    Can someone assist? 

    Here is some code:

    Drop Down List:

    @(Html.Kendo().DropDownListFor(m => m.SelectedPrinter)
    .HtmlAttributes(new { style = "width:100%" })
    .OptionLabel("Select printer...")
    .DataSource(source =>
    source.Read(read =>
    read.Action("GetCascadePrinters", "Home")


    .DataSource(dataSource => dataSource.Ajax()
    model =>
    model.Field(f => f.UserName).Editable(false);
    model.Field(f => f.FirstName).Editable(false);
    model.Field(f => f.LastName).Editable(false);
    model.Field(f => f.PrincipalCreationDate).Editable(false);
    model.Id(p => p.UserName);
    .Read("Editing_Read", "Home")
    .Update("Editing_Update", "Home")


    public ActionResult Editing_Update([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<User> usr, UsersViewModel uvm, string SelectedPrinter)

    // Check if model is valid
    // Get User from UserID
    // Build Trigger File
    // Send to Bartender Trigger Directory
    if (usr != null && ModelState.IsValid)
    foreach (var product in usr)
    // productService.Update(product);
    return Json(usr.ToDataSourceResult(request, ModelState));

    Any Help is appreciated.

  2. Answer
    Danail Vasilev
    Danail Vasilev avatar
    1476 posts

    Posted 18 Feb Link to this post

    Hi Jason,

    Thank you for contacting us.

    You can use a particular event (e.g., saveChanged, edit), where you can get the selected item of the dropdownlist:

    I can also suggest that you examine the getting started resources of Kendo UI controls the corresponding MVC wrappers:

    Let me know if I can assist you further with our products.

    Danail Vasilev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
Back to Top