Is it possible to remov开发者_开发问答e a group or groups from a DW at runtime?
No, but you can collapse the group header and detail bands (e.g. dw.Modify ("datawindow.header.1.height=0")). This should get you close to the same effect.
Good luck,
Terry.
Instead of removing the group, you can swap out the whole DataWindow. To do this you make your grouped and ungrouped DataWindows so they have the same column definitions (one way is to use the same select). Retrieve your data into a DataStore. Then set whichever DataWindow you want to show and share from the DataStore. You can change the DataWindow after you've retrieved data, you just have to share the data again. This lets you have a completely different presentation for the grouped and ungrouped view. For example, your grouped DataWindow could be Freeform, and the ungrouped one could be Grid. One caveat is that you may have to make sure you have the same computed columns in the DataWindows you're sharing. I say may because the help says you have to, and I saw it for myself in older versions of PB. However we have a PB 11.2 app with many shared-to DataWindows that have computes that aren't in the source and they work fine. Your Mileage May Vary.
精彩评论