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
810
What is the best strategy for deleting relationships in an UltraGridView for a M2M relationship?
posted

My application has a navigable UltraWinTree in the left pane and an UltraGrid in the right pane that
shows the selected tree node.

Let's say I have a groups table, a computers table and a ComputerGroups table that shows the M2M relationship between computers and groups.

And there are some other tables I want to show in the child sub bands of a computer row so I am using a BindingSource tied to a DataSet so that I can drill down into a computer grid row and show the child sub bands. When a group tree node is selected I call UltraGrid.SetDataBinding with the BindingSource (my dataset) and the computers table name and use a grid_FilterRow event to decide what rows to show based on the tree node group name - e.g. show only the computers in whatever group is selected in the tree rather than all computers. Or in a different node, perhaps only the groups for the computer that is selected.

My question is - how do I capture the row delete such that the row is not actually deleted but rather I can just delete the relationship from the ComputerGroups table? Is this possible? Is my overall strategy ill thought? AfterRowDeleted seems too early and BeforeRowDeleted seems too late.

I could use some advice on the general strategy as I'm not enthused about having to filter the rows shown in a grid view rather than just give it an already subsetted data from a DataView.

Thanks, Dave

Parents
No Data
Reply
  • 810
    posted

    I could really use some help on this.

    I am intercepting grid_BeforeRowsDeleted and deleting the relationship just fine but after my event handler exits the row still shows because I have not figured out how to force the filter to again show the view which will now now show the row I deleted the relationship for. Some property like "reshow the view after the filter data changed" would be nice. Any suggestions??? Thanks, Dave

Children