Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

DataGridTextColumn header binding dynamically

$
0
0

I want to bind WPF DataGridTextColumn dynamically. I try as follows

<DataGrid ><DataGrid.Columns><DataGridTextColumn  Binding="{Binding NAME}" ClipboardContentBinding="{x:Null}" Header="{StaticResource colName}"    /></DataGrid.Columns></DataGrid>

when colName is null its given an exeption and I can't run the page. How can I assign a default value when colName is null? 


Viewing all articles
Browse latest Browse all 18858

Trending Articles



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