绑定到 DevExpress GridControl TotalSummary
我有一个基本的新手绑定问题,这不一定与所使用的控件直接相关。不管怎样,事情是这样的:我有一个定义了 TotalSummary 的 DXGrid,它计算网格的行数。
<dxg:GridControl.TotalSummary>
<dxg:GridSummaryItem x:Name="grdCompleteCount" FieldName="ar_id" SummaryType="Count"/>
</dxg:GridControl.TotalSummary>
现在我想不在网格底部显示计数,因为它是自动完成的,但想将其绑定到另一个元素,例如文本块。像这样的事情:
<TextBlock x:Name="statusBarGridCount"
Text="{Binding ElementName=grdCompleteCount, Path=Value}"
TextAlignment="Right"
Width="190" />
但是这种方法不起作用,因为我不确定如何获得我正在寻找的价值。绑定有什么问题吗?
I have a basic newbie binding question, which isn't necessarily directly related to the control used. Anyway, here's the thing: I have a DXGrid with a TotalSummary defined, which counts the rows of the grid.
<dxg:GridControl.TotalSummary>
<dxg:GridSummaryItem x:Name="grdCompleteCount" FieldName="ar_id" SummaryType="Count"/>
</dxg:GridControl.TotalSummary>
Now I'd like to display the count not at the bottom of the grid as it is done automatically, but would like to bind it to another element, say, a textblock. Something like this:
<TextBlock x:Name="statusBarGridCount"
Text="{Binding ElementName=grdCompleteCount, Path=Value}"
TextAlignment="Right"
Width="190" />
But this approach doesn't work as I'm not sure how to get to the value I'm looking for. What's wrong with the binding?
好的,已经知道了,不用担心...:) 就是这样工作的:
Ok, got it already, don't worry... :) Works that way: