Hi,
I'm trying to add the total number of row in the grid but i want to display it under the row number (see pic).
I've use the code below:
It works fine except that if number is important (more that 999), the content of the TextBlock is not displayed correctly (some number are truncated).
Any ideas on how to solve that ?
Thanks !
I'm trying to add the total number of row in the grid but i want to display it under the row number (see pic).
I've use the code below:
public
void SetTextBoxTotalFooter()
{
// Set the binding on the footer containing the number of row
var indicatorPresenter = this.FooterRow.ChildrenOfType<IndicatorPresenter>().First();
var grid = indicatorPresenter.ChildrenOfType<Grid>().First();
var tb = new TextBlock
{
HorizontalAlignment =
HorizontalAlignment.Center,
VerticalAlignment =
VerticalAlignment.Center,
Text =
this._Xwg.Items.Count.ToString()
};
if (grid.Children.Count == 1)
{
grid.Children.Insert(1, tb);
}
else
{
grid.Children[1] = tb;
}
}
It works fine except that if number is important (more that 999), the content of the TextBlock is not displayed correctly (some number are truncated).
Any ideas on how to solve that ?
Thanks !