This sample illustrates how to solve the following issues:
1) Show detail buttons in random position (for example, on the right side of the grid)
2) Show/hide the detail button in each row according to developer requirements.
Question Comments
Added By: Keith Plummer at: 10/2/2013 9:56:04 PM
This is great. I used the example code and it is working great except I'm missing one extra step. I would like to change the image based on edits made in the detail grid. Specifically if they add a row in the detail grid then I would like to change the image on the master row to reflect that data now exists in the detail row. I use the image to indicate whether there is detail data or not. My master query counts the detail records and determines which image to show. If there are no details then the add comment image shows. If they click on the image and add a detail row, then I need to update the show detail image to indicate that there are now detail records.
My problem is, I don't know how or which event to use to see the detail records from the master and I don't know how or which event to use to see the master records from the details.
Thanks in advance for anything that may help.
Added By: Thue Møller Jensen at: 11/10/2015 1:56:19 AMI was a bit confused by this sample. Aren't you using the wrong value for DetailRows.IsVisible(keyValue)) and grid.CollapseDetailRow(" + keyValue + ") ?
According to the documentation the value should be VisibleIndex i.e. DetailRows.IsVisible(col.VisibleIndex)) and grid.ExpandDetailRow(" + col.VisibleIndex + ").
If you run your sample, an try and expand row 1 or 3, then row 2 or 4 is expanded (your category id's start with 1 and the visible index starts with 0).