Hi,
Is there a way to bind Grid's number of record in XAML?
Ex. The grid.ItemSource = CustomerList.
In the Xaml file, I want to show Customor record count in the footer row.
<
igGrid:TemplateColumn.FooterTemplate>
<DataTemplate>
Can I bind grid's number of row to the TextBlock?
Thank you,
Amy
Thank you.
Sure. I set up a simple sample to demonstrate.
In it I create a simple ViewModel that exposes an IList<T> property called Data. Next I set an instance of that ViewModel as my UserControls DataContext.
Once thats done all I have to do is set the binding on a TextBlock:
TextBlock Text="{Binding Data.Count}" />
The sample app is attached.
Devin
Yes, the count I want to show is the number of items in the ItemSource.
Can you please tell me how to bind ItemSource count in Xaml? I don't want to bind in the code behind.
You just want to show a count of the number of items in your ItemsSource? Can you simply bind the to the Count or Length property of your itemsource rather than ask the grid? I don't think we expose that information through the grids API.
Have you looked at using a summary row?