Hi All
We needed a row number column in our radGridView hence we followed a suggestion wherein we create a custom column type like this --
Public Class RowNumberColumn
Inherits Telerik.Windows.Controls.GridViewDataColumn
Public Overrides Function CreateCellElement(ByVal cell As GridViewCell, ByVal dataItem As Object) As FrameworkElement
MyBase.CreateCellElement(cell, dataItem)
Dim col = cell.Column
Dim textBlock1 As TextBlock = cell.Content
If (textBlock1 Is Nothing) Then
textBlock1 = New TextBlock()
End If
Dim t As IList = DataControl.ItemsSource
textBlock1.Text = (t.IndexOf(dataItem) + 1).ToString()
Return textBlock1
End Function
End Class
And then use this new column as --
<reservingUi:RowNumberColumn Header="#" IsFilterable="True" IsSortable="True"/>
Can you please advise on how to enable column filtering and sorting based on the value in the textBlock ?
Thanks !
We needed a row number column in our radGridView hence we followed a suggestion wherein we create a custom column type like this --
Public Class RowNumberColumn
Inherits Telerik.Windows.Controls.GridViewDataColumn
Public Overrides Function CreateCellElement(ByVal cell As GridViewCell, ByVal dataItem As Object) As FrameworkElement
MyBase.CreateCellElement(cell, dataItem)
Dim col = cell.Column
Dim textBlock1 As TextBlock = cell.Content
If (textBlock1 Is Nothing) Then
textBlock1 = New TextBlock()
End If
Dim t As IList = DataControl.ItemsSource
textBlock1.Text = (t.IndexOf(dataItem) + 1).ToString()
Return textBlock1
End Function
End Class
And then use this new column as --
<reservingUi:RowNumberColumn Header="#" IsFilterable="True" IsSortable="True"/>
Can you please advise on how to enable column filtering and sorting based on the value in the textBlock ?
Thanks !