Server side function not running

9 posts, 0 answers
  1. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 15 May 2015 Link to this post

    Hi

     I have a RadGgrid witht he following template section:

    <telerik:GridTemplateColumn HeaderText="Arrival" SortExpression="LocationArrival" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowFiltering="false" UniqueName="LocationArrival">
    <ItemTemplate>
    <asp:CheckBox ID="chkActivityArrival" runat="server" AutoPostBack="True" visible="false" OnCheckedChanged="chkActivityArrival_CheckedChanged"/>
    </ItemTemplate>
    </telerik:GridTemplateColumn>

     

    However when I click the checkbox the function chkActivityArrival_CheckedChanged on the server isn't being hit. The controls visibility is controlled in the code behind.

    I have the same code n other grids and they work OK, what would be causing this..

    Andy

  2. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 18 May 2015 in reply to Andy Green Link to this post

    Further to this, the problem is that the Grid_Load event is being fired. Not sure why as I hace checked the config and the running of similar grids that work ok.

    On the working grinds the PageLoad is run, here I have if not page.ispostback so nothing is done, they then jump to the required routines to run.

    On the problem grid after PageLoad it runs the Grid_Load.

     Andy

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 19 May 2015 Link to this post

    More info

    I have a comment in my code of the working grid:

    Protected Sub rdGrid_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rdGrid.NeedDataSource

    'if enableviewstate is set to false this will always fire just after page load before anything else.
    If Page.IsPostBack Then
                GridLoad()
    End If

    End Sub

    I have the Grid EnableViewState="true"  on th working and non working grids, but one is firing needdatasource and one isn't

     Andy

  5. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 19 May 2015 Link to this post

    I have found what is going on but not why.

    I have a function that runs on page load GetSelections() this loads up from the profile system user preferences its these preferences that are then used to load data into the grid.

    These are the page load functions that run with the ActivityGrid Load beiong the routine that gets data and binds it to the grid.

    The problem is the Grouping

            Local_ActivityGrouping = Profile("SiteGroupPreferences_" + SiteGroup_ID.ToString + ".ActivityGrouping")

    'If Local_ActivityGrouping Then
    ' rdActivity.MasterTableView.GroupByExpressions.Add(New GridGroupByExpression(rdActivity.MasterTableView.GetColumnSafe("Activity")))
    'Else
    ' rdActivity.MasterTableView.GroupByExpressions.Clear()
    'End If

     

    Why would presetting the grid groupby cause a NeedDataSource to be called when clicking on a checkbox within the grid.

    Andy

  6. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 20 May 2015 Link to this post

    Hi Andy,

    Note that each operation such as Filtering, Paging, Grouping, Sorting, etc. fires NeedDataSource event since those operations require fetching the data from the datasource. You can examine the following help article for more information.

    Regards,
    Kostadin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  7. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 20 May 2015 in reply to Kostadin Link to this post

    Hi Kostadin

    Read that several times, the problem is the Grouping being set in code, why once you group why does it still fire the needdatasource.

    If I remove the grouping its fine.

    Andy

  8. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 25 May 2015 Link to this post

    Hi Andy,

    I am afraid I was unable to replicate the issue on my side. Generally NeedDataSource event will be fired only if you have changed the data or the grid structure. I prepared a small sample which demonstrates that the NeedDataSource is not fired after I checked/unchecked the CheckBox control. Please give it a try and let me know about the result.

    Regards,
    Kostadin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  9. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 28 May 2015 Link to this post

    Thanks Kostadin

    I think I may have lead you down the wrong path here. I have been looking at this for a few days now, and the problem seems to be coming from the RadComboBox with checkboxes when a few are selected. I have a radCombo box with check boxes in my criteria for filtering the grid data.

    If I select all it always fails but if I select 1 or 2 such that the message n item checked doesn't show the correct event is fired on the server. IE it doesn't run the needdatasource.

    Is there an issue with the checkboxes in a combo box?

    Andy

     

  10. Angel Petrov
    Admin
    Angel Petrov avatar
    1007 posts

    Posted 29 May 2015 Link to this post

    Hi Andy,

    I have already provided an answer regarding this issue in the official support ticket you have opened. In order to avoid duplicate posts I recommend that we continue our conversation there. Once the problem is resolved you can share your findings with he community thus helping other members resolve similar cases.

    Regards,
    Angel Petrov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017