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

WPF Datagrid with header locked

$
0
0

Hi to all,

I have a Datagrid with ItemSource pointing a set of machine object :

<DataGrid AutogenerateColumns="False" ItemSource={Binding SelectedEntity.Machines} /><DataGrid.Columns><DataGridTextColumn Binding="{Binding MachineName}" Header="Machine name" /><DataGridTextColumn Binding="{Binding IPAddress1}" Header="IP1" /><DataGridTextColumn Binding="{Binding IPAddress2}" Header="IP2" /></DataGrid.Columns></DataGrid>

The Machines Dal-Object contains a set of Machine, the properties of each machine are machinename, ipaddress1, ipaddress2. The problem is that the header it's locked!!

But if I use code below the header unlocked but I do not knowhow to read data:

<DataGrid AutogenerateColumns="False" ItemSource={Binding SelectedEntity} /><DataGrid.Columns><DataGridTextColumn Binding="{Binding MachineName}" Header="Machine name" /><DataGridTextColumn Binding="{Binding IPAddress1}" Header="IP1" /><DataGridTextColumn Binding="{Binding IPAddress2}" Header="IP2" /></DataGrid.Columns></DataGrid>

Any suggestions?

thanks in advance,

Best regards,

CS


Viewing all articles
Browse latest Browse all 18858

Trending Articles



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