Welcome to the Xceed Community | Help
Community Search  
More Search Options

How to use a ForeignKeyConfiguration to auto-detect run-time Enum for cell drop-down list of a Column?

Page 2 of 2 (21 items)   < Previous 1 2
Sort Posts: Previous Next
  •  07-07-2009, 3:28 PM Post no. 22346 in reply to 22344

    Re: How to use a ForeignKeyConfiguration to auto-detect run-time Enum for cell drop-down list of a Column?

    Attachment: WpfApplication1.zip

    OK. I spoke with one of the developers and he says it will not be possible for you to do what you want in XAML. That said, attached you will find an example that demonstrates what you need to do in code behind. Note that if you change the type of enumeration dynamically, the ComboBox will not show a selected value but the new enumeration values will be displayed in the drop down.

    I hope this helps!


    Senior Technical Writer
    - Xceed Software

    In three words I can sum up everything I've learned about life: it goes on.
  •  07-08-2009, 10:45 AM Post no. 22370 in reply to 22346

    Re: How to use a ForeignKeyConfiguration to auto-detect run-time Enum for cell drop-down list of a Column?

    OK, that's great - that resolves the issue of populating the ItemsSource for the Column (combobox) with the run-time Enum enumerators.

    However, if the ForeignKeyConfiguration is defined in the XAML like in the project I sent you, the property it is bound to never gets called at all, even if it just returns a list of string values, regardless of any Enum.  I placed a breakpoint in the AlertEvents 'get' accessor and it is never hit.  Is this expected behaviour or a bug?


    Associate, .NET Development
    Morgan Stanley, UK
  •  07-08-2009, 11:07 AM Post no. 22373 in reply to 22370

    Re: How to use a ForeignKeyConfiguration to auto-detect run-time Enum for cell drop-down list of a Column?

    It won't work in XAML since the column, and therefore the ForeignKeyConfiguration, are not in the visual tree. It is normal that the AlertEvents property is never called since the RelativeSource binding cannot be resolved. That is the reason why, in the attached code, the ForeignKeyConfiguration is set in code and not in XAML.
    Senior Technical Writer
    - Xceed Software

    In three words I can sum up everything I've learned about life: it goes on.
  •  07-08-2009, 11:13 AM Post no. 22375 in reply to 22373

    Re: How to use a ForeignKeyConfiguration to auto-detect run-time Enum for cell drop-down list of a Column?

    Ok, thanks, that makes perfect sense.  Admittedly, I think the example I saw where the ForeignKeyConfiguration was defined in the XAML, it referred to static properties in Application.Current, i.e., http://xceed.com/CS/blogs/dontpanic/archive/2009/06/01/sneak-peek-at-version-3-2.aspx

    Thanks for all your help in furthering my understanding.

    Smile Jason


    Associate, .NET Development
    Morgan Stanley, UK
  •  07-08-2009, 11:19 AM Post no. 22376 in reply to 22375

    Re: How to use a ForeignKeyConfiguration to auto-detect run-time Enum for cell drop-down list of a Column?

    No problem!

    The code in the blog post probably did work at some point, either by design or by accident Smile. Things sometimes change between the time I write code for documentation purposes and when the product is released...


    Senior Technical Writer
    - Xceed Software

    In three words I can sum up everything I've learned about life: it goes on.
  •  07-08-2009, 11:26 AM Post no. 22377 in reply to 22376

    Re: How to use a ForeignKeyConfiguration to auto-detect run-time Enum for cell drop-down list of a Column?

    No, the blog post I think works fine as it uses static data.  I tried to apply it to non-static data in the visual tree, hence why it didn't work.  But all clear now Smile
    Associate, .NET Development
    Morgan Stanley, UK
Page 2 of 2 (21 items)   < Previous 1 2
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.