Example for detail grid with data driven checkbox columns

4 posts, 0 answers
  1. Ron
    Ron avatar
    6 posts
    Member since:
    Mar 2013

    Posted 07 Nov 2018 Link to this post

    Our application has several list/detail grids where the detail portion has differing numbers of checkbox columns from one main entry to another.  Additionally, the number, title, enabled state, and check state of each of the check boxes is driven by data stored in our database.  The entire grid is on a RadAjax panel.  We are finding that when one detail grid is already open and the user clicks another, the callback does a data bind first for the old detail and then for the new one, resulting in two sets of BL calls.  I suspect that this is a result of how we are creating the check box columns - it is done in back-end code which is called in the OnLoad event handler.  Does Telerik have any examples of the proper way of handling these types of column creations and updates so that the Ajax calls will work properly and not require the entire grid be redrawn?

    TIA,

    Ron L.

     

  2. Eyup
    Admin
    Eyup avatar
    3797 posts

    Posted 12 Nov 2018 Link to this post

    Hi Ron,

    Here are some suggestions regarding this scenario:

    1. Binding:
    https://www.telerik.com/support/kb/aspnet-ajax/grid/details/how-to-bind-radgrid-properly-on-server-side

    2. Definition - if you are creating the grid programmatically, I suggest that you do it using the Page_Init event handler:
    https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/defining-structure/creating-a-radgrid-programmatically#creating-a-hierarchical-grid-programmatically

    3. Disable AJAX while developing your app:
    https://www.telerik.com/support/kb/aspnet-ajax/ajaxmanager/details/get-more-descriptive-errors-by-disabling-ajax

    4. You can try to use ServerBind or Client hierarchy load modes to query the database only a single time for binding purpose:
    https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/hierarchical-grid-types-and-load-modes/hierarchy-load-modes

    After these conditions are met and the application is working as expected, you can enable AJAX back and observe the result.

    I hope this will prove helpful.

    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Ron
    Ron avatar
    6 posts
    Member since:
    Mar 2013

    Posted 12 Nov 2018 in reply to Eyup Link to this post

    Hello Eyup

    Thank you for the response.  I have looked over the links you included, and there are definitely places I need to make changes in our code.  I am still somewhat confused though about how to implement one of our requirements though.  That is, our detail grids may have different numbers of checkbox columns depending on certain parameters of the main row.  So the first row may have 5 check boxes while the 8th row may only have 3.  It seems that your example, where the grids are created in the OnInit handler, have the OnInit also creating the template columns; in our case, I don't believe that the OnInit will have enough information available for our code to be able determine the correct number of columns.  I believe that neither the parent row selection ID nor the parent row keys are available in the OnInit handler.  Am I incorrect in something here?  If not, do you have a way that I can properly build these columns?

    TIA

    Ron L.

  4. Eyup
    Admin
    Eyup avatar
    3797 posts

    Posted 15 Nov 2018 Link to this post

    Hello Ron,

    Your assumption is correct. You can try to create the other columns during Page_Init and add the checkbox columns during DetailItemTableBind event handler.

    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top