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

DataBound event not being recognized

4 Answers 380 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
TAD RHODES
Top achievements
Rank 1
TAD RHODES asked on 21 Jan 2013, 02:45 PM
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

4 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 23 Jan 2013, 09:10 AM
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!
0
TAD RHODES
Top achievements
Rank 1
answered on 24 Jan 2013, 04:22 PM
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
0
Accepted
Dimiter Madjarov
Telerik team
answered on 25 Jan 2013, 11:19 AM
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!
0
TAD RHODES
Top achievements
Rank 1
answered on 28 Jan 2013, 09:05 PM
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
Tags
ComboBox
Asked by
TAD RHODES
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
TAD RHODES
Top achievements
Rank 1
Share this question
or