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

Client OnComplete event is not defined

2 Answers 249 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jane
Top achievements
Rank 1
Jane asked on 26 Jul 2012, 05:35 PM
I am using a Grid control with AJAX binding, and need to run some JavaScript after AJAX request completes. 
Tried defining OnComplete event but it causes a compile error.  Is where a workaround? 

Html.Telerik()
                .Grid(Model)
                .Name("scenarioGrid")
                .DataBinding(dataBinding => dataBinding.Ajax()
                            .Delete("Delete", "Scenario").Select("Index", "Scenario"))
                .DataKeys(keys => keys.Add(c => c.Id))
                .Columns(columns =>
                {
                    columns.Template(o => o.Name).Title("Scenario")
                        .FooterTemplate(@<text>Total @Model.Count() </text>);
                    columns.Bound(o => o.IsLocked);
                    columns.Bound(o => o.ContractMonth);
                    columns.Bound(o => o.CreateDate);
                    columns.Command(commands =>commands.Delete().ButtonType(GridButtonType.Image)).Title("Delete");
                }
                        )
                        .Sortable()
                        .Scrollable(scroll => scroll.Height(200))
                        .ClientEvents(events => events.OnDelete("onDelete").OnComplete("onComplete"))
                )

Compiler Error Message: CS1061: 'Telerik.Web.Mvc.UI.Fluent.GridClientEventsBuilder' does not contain a definition for 'OnComplete' and no extension method 'OnComplete' accepting a first argument of type 'Telerik.Web.Mvc.UI.Fluent.GridClientEventsBuilder' could be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 52:                         .Sortable()
Line 53:                         .Scrollable(scroll => scroll.Height(200))
Line 54:                         .ClientEvents(events => events.OnDelete("onDelete").OnComplete("onComplete"))
Line 55:                 )
Line 56:                             </div>

Source File: c:\AmericanAirlines\RTAS\version9\AA.RecurrentTraining.Web.UI\Areas\Planning\Views\Scenario\Index.cshtml    Line: 54 



2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 27 Jul 2012, 06:57 AM
Hello,

Please post your question in below link, so may get your solution ASAP.

http://www.telerik.com/community/forums/aspnet-mvc/grid.aspx

Thanks,
Jayesh Goyani
0
Jane
Top achievements
Rank 1
answered on 27 Jul 2012, 02:17 PM
Tags
Grid
Asked by
Jane
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Jane
Top achievements
Rank 1
Share this question
or