Ticket T591262
Visible to All Users

Add a new row to a grid from a modal window that has a grid also.

created 7 years ago

I am pretty new to WPF and your devexpress controls.  I'm lost to how to implement this feature.  What I'm trying to figure out is how to add a user from one grid to another grid in simple terms.  I have a list of available users that can be selected into the user mandatory grid.

So my end goal here is on my main window I have an add button and a GridA with Name column.  When I click on the Add button it will show a modal window with a gridB that has a list of all available users names except who is not on GridA.    I would like to double-click the row to add that user to GridA.

For example, When I load for the application for the first time my GridA is empty.  I click on the add button.  A modal window pops up with the Available Users in gridB to choose from.   I have John, Andy, Ben, and Natalie for all user to choose from.  I double click on Ben.  He gets added to gridA on the main window.  I click the Add button again, then a modal window pops up with the Available User in gridB.  Now I would only see John, Andy, and Natalie.  Ben would not show up because he is on gridA.

I will probably use IList/IEnumerable list to binding my data to my grids.  I have a service call that gets a list of all my user from the database.  I will probably create two more list objects for my availableUsers and mandatoryUsers.

Any help would be greatly appreciated.

Answers approved by DevExpress Support

created 7 years ago (modified 7 years ago)

Hello Justin,

Thank you for your detailed description. Actually, there are no specifics of the DevExpress controls so you can use common approaches as with standard controls. Just in case, I have prepared and attached a sample project demonstrating how to accomplish this task. Please take a moment to review it and let me know if you have additional questions.

Thanks,
Michael

    Comments (2)
    JS JS
    Justin Sandoval 7 years ago

      Thank you!  That is totally what I needed.  Good work!

      DevExpress Support Team 7 years ago

        You're welcome!

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.