Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

WPF Data Grid Binding Data to one Different Source than Property Binds

$
0
0

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


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>