Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
Problems with get_gridResponseObject()
posted

Hi everyone !!!

I'm having a problem with WebDataGrid. I'm using 13.1 and in DataFiltered client side event I'm trying to obtain a parameter that I put in server side on Page_Load event.

Page_Load event (server side)

GridView1.CustomAJAXResponse.AdditionalProperties.Add("rowCount", -1);

Javascript Client Side

function GridView1_DataFiltered(sender, eventArgs) {
   ///<param name="sender" type="Infragistics.Web.UI.WebDataGrid"></param>
   ///<param name="eventArgs" type="Infragistics.Web.UI.DataFilteredArgs"></param>

   //Add code to handle your event here.
   var rowCount = eventArgs.get_gridResponseObject().AdditionalProperties.rowCount;
   if (rowCount != -1) {
      $("#lblTotal").text("Total: " + rowCount + " Registro(s)");
   }
}

Until yesterday, I was trying to fix another problem I had with paging behavior but, after fix it, I encountered with the filtering problem.

Thanks a lot !!!!

Gustavo.-

Parents
No Data
Reply
  • 10685
    Verified Answer
    Offline posted

    Hello Gustavo,

     I have tested this comparing the Events firing Order for the standard AJAX Response ClientSide event and the FilteringClientEvent WebDataGrid1_Filtering_DataFiltered and I have done some debugging.

    It appears the firing order is such:

    When filtering happened first the Data Filtered event fires and at this time the custom response object is still unavailable, since the WebDataGrid1_Grid_AJAXResponse event has not occurred yet. This is why the property is initially undefined. You could use a global variable in order to work around this and yet, next time the Data Filtered is fired the custom Properties are accessible BUT the old value is stored and not the actual one. I suggest looking into the code will make more sense than describing it in words, so please feel free to refer to the attached file and debug it on your own.

    Please let me know if this helps you.

    CustomAJAXresponse_AdditionalProperties.zip
Children
No Data