Approved
Last Updated: 15 Aug 2017 10:03 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 22 Jan 2016 09:58
Category: GridView
Type: Feature Request
0
ADD. RadGridView - paging functionality in self-reference hierarchy
To reproduce:

Sub New()        
    InitializeComponent() 
    Dim items As New List(Of WorkOrder)
    For index = 1 To 56
        items.Add(New WorkOrder(index, "Item" & index, 0))
    Next
    Dim rand As New Random
    For index = 57 To 500
        items.Add(New WorkOrder(index, "Item" & index, rand.Next(1, 56)))
    Next

    Me.RadGridView1.Relations.AddSelfReference(Me.RadGridView1.MasterTemplate, "Id", "ParentId")
    Me.RadGridView1.DataSource = items
    Me.RadGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill
    Me.RadGridView1.EnablePaging = True
    Me.RadGridView1.PageSize = 20
End Sub

Public Class WorkOrder
    Private _id As Integer
    Private _name As String
    Private _parentId As Integer
    
    Public Sub New(id As Integer, name As String, parentId As Integer)
        Me._id = id
        Me._name = name
        Me._parentId = parentId
    End Sub

    Public Property Id() As String
            Get
                Return _id
            End Get
            Set(ByVal value As String)
                _id = value
            End Set
        End Property
    
    Public Property Name() As String
            Get
                Return _name
            End Get
            Set(ByVal value As String)
                _name = value
            End Set
        End Property

    Public Property ParentID() As Integer
            Get
                Return _parentId
            End Get
            Set(ByVal value As Integer)
                _parentId = value
            End Set
        End Property
End Class

Workaround: use standard hierarchy: http://docs.telerik.com/devtools/winforms/gridview/hierarchical-grid/hierarchy-of-one-to-many-relations
Attached Files:
0 comments