Ticket Q217196
Visible to All Users

XPServerCollectionSource master detail grid controls

created 16 years ago

Hello,
I try to rewrite my application to use gridcontrol in server mode using XPServerCollectionSource. For the master grid all works fine, but I have two gridcontrols for master-detail on my form. When I try to bind the detail grid to the master grid using the old (XPCollection) approach via the GridControl.DataMember property, it doesn't work. Can you please help me how to correctly create master-detail for two gridcontrols?
Thanks, Norbert

Answers approved by DevExpress Support

created 16 years ago (modified 12 years ago)

Hello Norbert,
Thank you for the question. The standard data-binding mechanism doesn't work when the XtraGrid works in Server mode. To achieve this goal you should handle the master view's FocusedRowChanged event in which you should manually re-fill your detail grid's data source. You will need to obtain a focused master object using the master view's GetRow method and then pass this object's detail collection to the detail grid's DataSource property.
Please try this solution and inform us of your results.
Thanks,
Stan.

    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.