Can't rebind RadGrid with Rebind()

2 posts, 0 answers
  1. Leo
    Leo avatar
    6 posts
    Member since:
    Jun 2013

    Posted 25 Jun 2013 Link to this post

    Hi,

    I'm having a problem with the Rebind() function in VB to clear the search content. Everytime I tried to step through the code, it showed that VB did run through the Rebind() function but returned nothing. Here's my code:

    In HTML:

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
    <UpdatedControls>
    <telerik:AjaxUpdatedControl ControlID="PickCarrierRG" LoadingPanelID="RadAjaxLoadingPanel1" />
    </UpdatedControls>
    </telerik:AjaxSetting>
    </telerik:RadAjaxManager>


    In Javascript:

    function clearsearchvalues(fromRWyesno)

    document.getElementById(
    "<%= HiddenTB_SearchPartyID.ClientID %>").value = "0";
    document.getElementById("<%= HiddenTB_SearchFree.ClientID %>").value = "0";
     
    document.getElementById("<%= HiddenTB_SearchRadius.ClientID %>").value = "0";
    document.getElementById("<%= HiddenTB_SearchCityID.ClientID %>").value = "0";
    var PickCarrierRSB = $find("<%= PickCarrierRSB.ClientID %>");
    PickCarrierRSB.clear();
    var CityRCB = $find("<%=CityRCB.ClientID%>");
    CityRCB.get_items().clear();
    CityRCB.set_value("");
    CityRCB.set_text("");

    if
    ( fromRWyesno == "yes" ) {
     
    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("rebindPickCarrierRG");
     
    }
     
    }
     
    function onJobRWClose() {

    document.getElementById(
    "<%= HiddenTB_HistoryID.ClientID %>").value = "0";
    clearsearchvalues("yes");
     
    }

    In VB:

    Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
    Dim myArg As String = e.Argument
    Dim myAction As String = CustGenClass.f_Split_ByComma(myArg, 1)
    Dim my1st As String = CustGenClass.f_Split_ByComma(myArg, 2)
    Dim myPartyID As String = Me.HiddenTB_PartyID.Text
    If myArg = "rebindPickCarrierRG" Then
    PickCarrierRG.Rebind()
    End If
    End Sub


    Like I said, I tried to step through the code thoroughly but couldn't find anything. I'm still learning all this so any help would be greatly appreciated. Thank you!
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 27 Jun 2013 Link to this post

    Hello,

    I reviewed the provided code but was not able to isolate anything obvious that may cause the problematic behavior. I tried to replicate the issue in an isolated sample on my side but to no avail. Could you please elaborate a bit more on what you exactly mean by "the RadGrid does not rebind"? Does the NeedDataSource event of the RadGrid fires correctly? If the issue is that the event is not hit please ensure that you have the RadGrid View State enabled. Sharing your RadGrid declaration will help us further research on the problem and do our best to isolate the root cause of the issue.

    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top