I want to bind the count of datasource(itemsource) for xamGrid in Page style. So tried in this way:
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Cell.Row.Manager.Rows.Count}"
but that is the number of rows in one page, same as pagesize, not the total count of datasource.
What's the right path for this case?
Or if xamGrid dataContext is viewmodel which has a property say TotalCount, how to bind it to a textbox in PageStyle?
Hello,
I have created sample application that demonstrates how you can bind the Text property of a TextBlock to the Count property of an ObservableColleciton which is used for items source for the XamGrd. In the sample application I created a style for the PagerCellControl using the default style as basis and added a TextBlock to its ControlTemplate. If you prefer to bind the Text of the TextBlock to a property of the DataContext of the XamGrid you can change the Path in the Binding for the Text property to
Path=Parent.Owner.Grid.DataContext.<PropertyName>
If you require any further clarifications please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hi Krasimir,
WIth your sample in zip file, you use ObservableCollection for ItemSource for xamGrid, then folloing binding in page style working fine:
Path=Parent.Owner.Grid.ItemsSource.Count
But when I use PagedCollectionView for ItemSource for xamGrid, above binding not working, not sure why.
Thank you very much. Try your solution. ItemSource.Count not working, DataContext.<PropertyName> working fine.