DataBound event not being recognized

5 posts, 1 answers
  1. TAD RHODES
    TAD RHODES avatar
    31 posts
    Member since:
    Jul 2009

    Posted 21 Jan 2013 Link to this post

    Hi,

    I have a straight forward implementation of cascading comboxes that doesn't seem to recognize the DataBound event.  I have downloaded the latest keno js files, but nothing seems to work.  When referencing the events I can see these actions available: Change, Close, Open and Select.

    Here is the code:
    @(Html.Kendo().ComboBox()
                       .Name("classes")
                       .HighlightFirst(true)
                       .Filter("contains")
                       .Placeholder("Select Class...")
                       .HtmlAttributes(new { style = "width: 300px;" })
                       .Suggest(true)
                       .DataTextField("Name")
                       .DataValueField("Id")
                       .DataSource(source => source.Read(read => read.Action("GetClassList", "RCS"))).AutoBind(true))
     
                @(Html.Kendo().ComboBox()
                      .Name("vendorsforClass")
                      .CascadeFrom("classes")
                      .AutoBind(false)
                      .Value("Select Vendor...")
                      .HtmlAttributes(new { style = "width: 300px;" })
                      .DataTextField("Name")
                      .DataValueField("Id")
                      .Events(e => { e.DataBound("vendorForClassChangeEvent")})
                      .DataSource(source =>
                          {
                              source.Read(read =>
                                  {
                                      read.Action("GetVendorListByClass", "RCS").Data("filterProducts");
                                  }).ServerFiltering(true);
                          }))
     
                <script type="text/javascript">
     
                    function vendorForClassChangeEvent() {
                        alert('here');
                        var combobox = $("#vendorsforClass").data("kendoComboBox");
                        combobox.open();
                    }
                     
                    function filterProducts() {
     
                        return {
                            classes: $("#classes").val()
                        };
                    }
    Any help or thoughts would be appreciated.

    Thank you,
    Tad
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2157 posts

    Posted 23 Jan 2013 Link to this post

    Hi Tad,

    I tried your code and everything seems to work as expected (including the dataBound event). I am attaching a sample project, which works on our side and the event is fired normally. Could you please take a look at it and let me know if it fits your case.

    Greetings,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. TAD RHODES
    TAD RHODES avatar
    31 posts
    Member since:
    Jul 2009

    Posted 24 Jan 2013 Link to this post

    Dimiter,

    Thank you for your reply and example.

    I know I'm missing something simple here and will probably be embarrassing when it's figured out.  However, this still does not work for me.  From what I can tell we have the same versions (mine newer) of the js files and I placed additional references, but still cannot get it to recognize.

    This is the actual VS error I received when running in debug mode.

    error CS1061: 'Kendo.Mvc.UI.Fluent.DropDownListEventBuilderBase' does not contain a definition for 'DataBound' and no extension method 'DataBound' accepting a first argument of type 'Kendo.Mvc.UI.Fluent.DropDownListEventBuilderBase' could be found (are you missing a using directive or an assembly reference?)

    Just to reiterate, I can see the other events like, Change, Close, Open, Select; just not DataBound.  Which again leads me to believe I may not have the latest, but I do, I think. 
    kendo.all.min.js --> Kendo UI Complete v2012.3.1315
    kendo.aspnetmvs.min.js --> Kendo UI Complete v2012.3.1308

    Does this give any hints?

    Thank you,
    Tad
  5. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2157 posts

    Posted 25 Jan 2013 Link to this post

    Hello Tad,

    Could you please ensure that you also have the latest Kendo MVC Wrappers assembly? More information on the subject is available in the Downloading and Installing and Upgrade Wizard  help topics.

    Regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. TAD RHODES
    TAD RHODES avatar
    31 posts
    Member since:
    Jul 2009

    Posted 28 Jan 2013 Link to this post

    Dimiter, awesome!  That was it.  I needed to remove the previous reference and then reference again the latest complete wrapper Kendo.Mvc.dll.

    Thank you so much.  I knew it was something easy, just needed some of that telerik wisdom!

    Thanks,
    Tad
Back to Top
UI for ASP.NET MVC is VS 2017 Ready