22 lines
672 B
C#
22 lines
672 B
C#
![]() |
using System.Collections;
|
|||
|
using System.Windows.Controls;
|
|||
|
using Telerik.Windows.Controls;
|
|||
|
|
|||
|
namespace SWS.CAD.Views.CustomControl
|
|||
|
{
|
|||
|
public class RowNumberColumn : GridViewDataColumn
|
|||
|
{
|
|||
|
public override System.Windows.FrameworkElement CreateCellElement(Telerik.Windows.Controls.GridView.GridViewCell cell, object dataItem)
|
|||
|
{
|
|||
|
TextBlock textBlock = cell.Content as TextBlock;
|
|||
|
|
|||
|
if (textBlock == null)
|
|||
|
{
|
|||
|
textBlock = new TextBlock();
|
|||
|
}
|
|||
|
textBlock.Text = ((this.DataControl.ItemsSource as IList).IndexOf(dataItem) + 1).ToString();
|
|||
|
return textBlock;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|