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
105
AllowHiding Propery Binding
posted

I have two columns in my XamDataGrid, one for displaying info in English, one for French. So I only want one of them in the FieldChooser depending on the language culture. I can do this in code, something like this,

For the English column: 

if

(TranslationManager.Instance.CurrentLanguage.TwoLetterISOLanguageName.Equals("en"

))

unboundFieldSourceE.Settings.AllowHiding =

AllowFieldHiding

.Default;

else

unboundFieldSourceE.Settings.AllowHiding =

AllowFieldHiding

.Never;

The code for the French column is the opposite. I'd like to know how to do this in Xaml through binding. It looks like that I have to write some sort of converter to accomplish it. I wonder if anyone has some experience o this.

Thanks a lot,

Shan

Parents
  • 138253
    Verified Answer
    Offline posted

    Hello Shan,

     

    Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I created a custom Converter and set it as a Converter in the AllowHiding Binding. Also I set the instance of the Converter to be the Source of the Binding, because the DataContext in the FieldSetting is null and all the bindings should use static source Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    XamDataGridAllowHiding.zip
Reply Children