Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4970
How to get the whole row count of datasource of xamGrid for databinding?
posted

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?

Parents
No Data
Reply
  • 30945
    Offline posted

    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

    ItemsCountBinding.zip
Children