hello
I am trying to implement a Grid View with row number column and pagination.That is, the row number can also be changed when the page is changed
but the code I wrote is that the row number column on each page is only 1 to 10. And by going to the next page the row number starts again from 1 and does not increase to 11 and more.
this is my cs code for row number:
public override FrameworkElement CreateCellElement(Telerik.Windows.Controls.GridView.GridViewCell cell, object dataItem)
{
TextBlock textBlock = cell.Content as TextBlock;
if (textBlock == null)
{
textBlock = new TextBlock();
}
textBlock.Text = string.Format("{0}", this.DataControl.Items.IndexOf(dataItem) + 1);
return textBlock;
}
and xaml code:
<telerik:RadDataPager DisplayMode="all" PageSize="10" Source="{Binding Items, ElementName=RadGridView}" />
also i need a label that represents the total number of Grid View rows. The value of this label must be updated by applying a filter or searching.
but my code always represents total number of Grid View rows and does not change with filtering.
Thanks!
Sara.