This is a migrated thread and some comments may be shown as answers.
Client side events are not firing on PartialView loaded ...
0 Answers 40 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Amit
Top achievements
Rank 1
Amit asked on 26 Nov 2010, 11:03 AM
Hi Guys,

I am loading a grid through partial view and two things are not working:

- Client side events are not being called.
- the paging link to ajax controller call doing a postback.

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Web.vwSearchResultCandidate>>" %>
<fieldset class="text_box_search">
    <legend>Search Result</legend>
    <script type="text/javascript" language="javascript">
        function Post_DataBound(e) {
            alert('hey');
            //            var grid = $('#SearchResultGrid').data('tGrid')
            //            index = (grid.currentPage - 1) * grid.pageSize;
            //            alert(index);
        }
    </script>
    <%= Html.Telerik().Grid(Model)
        .Columns(columns =>
        {
            columns.Add(o => o.CandidateID).Title("Candidate ID");
            columns.Add(o => o.FirstName+ ' ' + o.FamilyName).Title("Name");
            columns.Add(o => o.Email).Title("Email");
            columns.Add(o => o.coreCompetency).Title("Skills");
            columns.Add(o => o.coreProjects).Title("Projects");
            columns.Add(o => o.corerole).Title("Roles");
            columns.Add(o => o.dateOfLastUpdate).Title("Last Updated");
            columns.Add(o => o.dateResumeUpdated).Title("Resume Updated");
            columns.Add(o => o.Suburb_Region).Title("Region");
        })
        .Name("SearchResultGrid")
                .Pageable(p => p
                          .Style(GridPagerStyles.NextPreviousAndNumeric | GridPagerStyles.PageInput)
                          .Position(GridPagerPosition.Both)
                          .PageSize(WebClient.Helper.SessionMaster.CandidateListPageSize)
                          )
                    .Sortable()
                    .Resizable(resizing => resizing.Columns(true))
        .Scrollable()
        .ClientEvents(e => e.OnDataBound("Post_DataBound"))
        .DataBinding(a => a.Ajax().Select("AjaxCandidateListPager", "Candidates"))
    %>
</fieldset>
Tags
Grid
Asked by
Amit
Top achievements
Rank 1
Share this question
or