This is a migrated thread and some comments may be shown as answers.

Example for detail grid with data driven checkbox columns

3 Answers 86 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 07 Nov 2018, 12:41 PM

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.

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 12 Nov 2018, 12:20 PM
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.
0
Ron
Top achievements
Rank 1
answered on 12 Nov 2018, 06:14 PM

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.

0
Eyup
Telerik team
answered on 15 Nov 2018, 04:21 PM
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.
Tags
Documentation and Tutorials
Asked by
Ron
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Ron
Top achievements
Rank 1
Share this question
or