locked
WPF Data Grid Binding Data to one Different Source than Property Binds RRS feed

  • Question

  • All,

    So I'm binding to my implementation which contains the security models Observable collection, my data grid in XAML binds to the Observable collection, everything works great, but i cant figure out how to bind the DataGrid background property to a local property

    Background="{Binding GridColor,FallbackValue=SteelBlue}" This does not work

    Can somebody point me in the right direction?

    Thanks

    Madaxe

    public ToggleButtonSecurityGrid()
    {
                InitializeComponent();
                this.DataContext= _SecurityImplementation;

    }

    public ObservableCollection<ApplicationSecurityModel> SecurityModels
            {
                get { return _SecurityModels; }
                set
                {
                    _SecurityModels = value;
                    OnPropertyChanged();
                }
            }

    <DataGrid 

                Name="SecurityDataGrid"
                ItemsSource="{Binding SecurityModels, 
                                                Mode=TwoWay, 
                                                NotifyOnSourceUpdated=True, 
                                                UpdateSourceTrigger=PropertyChanged}"


    As Busy As A Bricky In Beirut

    Saturday, April 11, 2020 4:52 PM

All replies