Class MainWindow Private data As New ObjectModel.ObservableCollection(Of Object)() Public Sub New() InitializeComponent() For i As Integer = 0 To 999 data.Add(New With{.Column1=$"Row {i}", .Column2=$"Value {i}{vbNewLine}JUST FOR FUN", .Column3=$"Data {i}"}) Next i WPF001.ItemsSource = data End Sub End Class
<Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:RowHeaderFinalRenderSize" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <DataGrid x:Name="WPF001" AutoGenerateColumns="True" HorizontalAlignment="Center" VerticalAlignment="Top" Width="780" Height="307" Margin="0,10,0,0"/> <Label x:Name="lb" BorderThickness="1" BorderBrush="Black" Margin="325,368,325,10" Content="{Binding ElementName=WPF001, Path=RowHeader.RenderSize.Height, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> </Grid> </Window>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)