Help with Multi-select master/detail under WinForms?

Help with Multi-select master/detail under WinForms?

Old forum URL:

dagware posted on Saturday, February 06, 2010

I have a list of Users, and each User has a list of their Roles. Using the standard BusinessListBase and BusinessBase combinations. They're represented on a WinForms form via two DevEx grids in a standard master/child relationship.

I've been toying with the idea of attempting to support multi-select. In other words, if you select 2 Users, the Roles list shows the Roles shared by the 2 users. If you add or delete a role, it gets added or deleted to all selected users.

Anyone have ane ideas on how to go about implementing something like this? I've thought about trying to use subclassing (or whatever we call it in C# <grin>), but I'm not sure I know how to implement that with the Generics that CSLA uses. I've also thought about trying to do it via interfaces, which seems the more likely way.

To make matters more complicated, I also have a data-bound combo-box that shows the currently-selected user's "Scheme". I'd love to be able to multi-select users, and change all their schemes at once using the combo-box. But this sounds even harder than the master/child issue, because of possible Begin/End Edit timings.

Has anyone tried something like this? Using CSLA? Anyone got any ideas?



ajj3085 replied on Monday, February 08, 2010

It depends on what grid you're using.  If you're using the stock grids, you may have to implement this yourself using SortedBindingList as a guide.  AddSort / RemoveSort makes it sound like you add a sort column with each call, so it looks to me as you should be able to do it.  But you'll have to implement your own AddSortCore method and do the sorting yourself.

If you have something like the Infragistics grid, it does the sorting for you, even without SortedBindingList, and it supports multiple column sorting.  So if your grid can do it, I'd read up on that.

For your "update selected rows" issue, I'd skirt the databinding issues by asking the cell to change its value directly.  Programmatically do what the user would.  The grid should act the same as if the user changed the values, and everything should just work. 

That's how I'd approach things, at least.


donaldjeo replied on Monday, April 12, 2010

i thinks you should read this tutorial....

I would be help full for you....  :)

katejohn replied on Wednesday, June 02, 2010

Your post is very impressive and informative. I have read it and agree with your views, ideas and opinions becasue it is the demand of the time. I am a web developer and working on a project of article directory, articleworlddb in these days. Therefore i am just putting short views here but after some days i shall go in details and provide complete information regarding the topic. Moreover i want to add some interesting things in my article directory as well.

Copyright (c) Marimer LLC