Hierarchical gridview problems

2 posts, 1 answers
  1. Peter Szintai
    Peter Szintai avatar
    28 posts
    Member since:
    Jul 2009

    Posted 17 Nov 2010 Link to this post

    Hi All,

    In our WinForms application we have some hierarchival gridviews (we call them master-detail grid). This week we upgraded to the new 2010.3 10.1109 version, the last version was the 2010.2 10.914, and the application worked fine with the older verion.

    But, now:
    In the UserAddedRow event the e.Row.Hierarchilevel is 1 always, and not 0 in the case of new master rows.

    In the UserDeletedRow event the e.Row.DataBoundItem is null, so, e.g.: e.Row.DataBoundItem.GetType().Name throws a NullReferenceException.

    Any idea?

    Best regards,

    Peter Szintai
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 17 Nov 2010 Link to this post

    Hello Peter,

    I've tried this out and it seems as though it's true.
    If you only have a parent / child relationship, then you could try something like this to get your 0/1 hierarchy level

    Private Sub RadGridView1_UserAddedRow(ByVal sender As System.Object, _
        ByVal e As Telerik.WinControls.UI.GridViewRowEventArgs) Handles RadGridView1.UserAddedRow
        If e.Row.ViewTemplate Is Me.RadGridView1.MasterTemplate Then
        End If
    End Sub

    and the UserDeletingRow event still has the databound object
    Private Sub RadGridView1_UserDeletingRow(ByVal sender As System.Object, _
        ByVal e As Telerik.WinControls.UI.GridViewRowCancelEventArgs) Handles RadGridView1.UserDeletingRow
    End Sub

    hope that helps, but let me know if you need more information

  3. DevCraft R3 2016 release webinar banner
Back to Top