Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Binding selected value of Dropdownlist to Grid

Binding selected value of Dropdownlist to Grid

Scheduled Pinned Locked Moved ASP.NET
htmlcsswpfwcfdocker
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Hi, I am using Kendo Dropdown list and Kendo Grid, when I select an item, in the dropdown, the Kendo grid should display the records for value of the selected item of the Kendo dropdown, when I change it, the records in the Grid also change. I am trying in the below way, not able to achieve, any help would be very helpful - thanks in advance.

    @{
    ViewBag.Title = "ListLookups";
    //Layout = "~/Views/Shared/_LayoutFinal.cshtml";
    }

    .k-edit-form-container {
        width: 500px;
    }
    

    @using (Html.BeginForm())
    {
    @Html.AntiForgeryToken()

        Lookup
        @(Html.Kendo().DropDownList().Name("Lookup").OptionLabel("Select")
                      .DataTextField("Text")
                                                     .DataValueField("Value").HtmlAttributes(new { style = "width:280px;", @id = "drpLookup" })
                              .DataSource(dataSource => dataSource.Read(read => read.Action("GetListOfLookupTables", "Admin")))
                              .Events(e =>
                                {
                                    e.Change("GetLookupTableValue");
                                })
    
                              )
    

    List of Contacts

                    @(Html.Kendo().Grid()
                        .Name("LookupGrid")
                .EnableCustomBinding(true)
                .AutoBind(false)
                .Columns(columns =>
                {
                    columns.Bound(p => p.Id).Hidden();
                    columns.Bound(p => p.Type);
                    columns.Bound(p => p.Description);
                    columns.Command(command => { command.Custom("View").Click("ViewLookupTableValues").HtmlAttributes(new { @class = "k-primary" }); }).Width(100);
                })
                    .Pageable()
                    .Sortable()
                    .Scrollable()
                             .Resizable(resize => resize.Columns(true))
                            .Filterable(x => x.Extra(false).Operators(O => O.ForString(str
    
    V 1 Reply Last reply
    0
    • I indian143

      Hi, I am using Kendo Dropdown list and Kendo Grid, when I select an item, in the dropdown, the Kendo grid should display the records for value of the selected item of the Kendo dropdown, when I change it, the records in the Grid also change. I am trying in the below way, not able to achieve, any help would be very helpful - thanks in advance.

      @{
      ViewBag.Title = "ListLookups";
      //Layout = "~/Views/Shared/_LayoutFinal.cshtml";
      }

      .k-edit-form-container {
          width: 500px;
      }
      

      @using (Html.BeginForm())
      {
      @Html.AntiForgeryToken()

          Lookup
          @(Html.Kendo().DropDownList().Name("Lookup").OptionLabel("Select")
                        .DataTextField("Text")
                                                       .DataValueField("Value").HtmlAttributes(new { style = "width:280px;", @id = "drpLookup" })
                                .DataSource(dataSource => dataSource.Read(read => read.Action("GetListOfLookupTables", "Admin")))
                                .Events(e =>
                                  {
                                      e.Change("GetLookupTableValue");
                                  })
      
                                )
      

      List of Contacts

                      @(Html.Kendo().Grid()
                          .Name("LookupGrid")
                  .EnableCustomBinding(true)
                  .AutoBind(false)
                  .Columns(columns =>
                  {
                      columns.Bound(p => p.Id).Hidden();
                      columns.Bound(p => p.Type);
                      columns.Bound(p => p.Description);
                      columns.Command(command => { command.Custom("View").Click("ViewLookupTableValues").HtmlAttributes(new { @class = "k-primary" }); }).Width(100);
                  })
                      .Pageable()
                      .Sortable()
                      .Scrollable()
                               .Resizable(resize => resize.Columns(true))
                              .Filterable(x => x.Extra(false).Operators(O => O.ForString(str
      
      V Offline
      V Offline
      Vincent Maverick Durano
      wrote on last edited by
      #2

      Hi, Your issue isn't actually direclty related to ASP.NET in general. There may be some here who knows about Telerik controls, but I believed you stand a better chance by posting it at Telerik dedicated forums: Forum threads about Grid Kendo UI for jQuery[^] Or atleast at JavaScript forums section: JavaScript Discussion Boards[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups