how count total record from Data grid to textblock
this is my data grid
<slData:DataGrid x:Name="FindDetailsDataGrid" AutoGenerateColumns="False" HeadersVisibility="All" Background="White" Visibility="Visible"
BorderBrush="Black" BorderThickness="2" SelectionChanged="FindDetails_SelectionChanged"
HorizontalScrollBarVisibility="Hidden" Grid.Row="1"
IsReadOnly="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Height="Auto" Width="Auto">
<slData:DataGrid.Columns>
<slData:DataGridTextColumn Binding="{Binding Path=Value}" Header="Road Names"/>
</slData:DataGrid.Columns>
</slData:DataGrid>
<TextBlock x:Name="Textblock1" HorizontalAlignment="Left" Margin="149,49,0,0" TextWrapping="Wrap" Text="ll" VerticalAlignment="Top" Width="75"/>
You can bind the text property of the TextBlock to Datagrid.Items.Count
https://msdn.microsoft.com/en-us/library/system.windows.controls.itemcollection.count(v=vs.110).aspx
Another way would be to bind directly to itemsource object Count property as it an enumerable object such as List<T> or ObservableCollection<T>
Thank you for reply but this is old question. I always work on easy ways.. I did it by very easy way
Textblock.Text =String.Format(selected.features. Count())
Its working