FilterChanging question

2 posts, 0 answers
  1. Jason Parrish
    Jason Parrish avatar
    92 posts
    Member since:
    Sep 2009

    Posted 14 Dec 2011 Link to this post

    The GridViewCollectionChangingEventArgs on the FilterChanging event does not appear to be updated correctly.  After the first filter change event, subsequent filters do not update NewItems and OldItems correctly.

    The NewItems(0) does not reflect the updated filtered text.  However, the NewValue does show the updated text.   The OldItems(0) always equals zero, but OldValue is correct.

    In addition, if the filter operator changes, the same discrepancy occurs, however the NewValue and OldValue are changed to an number.  I'm assuming it is the enumerator of the operator.

    See the screenshot and code example.  I've opened a support ticket in case it is an actual bug, but hoping it is not and I'm just using it incorrectly.

    Imports System.ComponentModel
    Public Class Form1
        Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
            Dim foo As New BindingList(Of Person)
            Dim i As Integer
            Do Until i = 100
                foo.Add(New Person("Name " & i.ToString))
                i = i + 1
            RadGridView1.DataSource = foo
        End Sub
        Public Class Person
            Property Name As String
            Public Sub New(ByVal Name As String)
                _Name = Name
            End Sub
        End Class
        Private Sub RadGridView1_FilterChanging(sender As Object, e As Telerik.WinControls.UI.GridViewCollectionChangingEventArgs) Handles RadGridView1.FilterChanging
            TextBox1.Text = e.NewItems(0).ToString
            TextBox2.Text = e.NewValue
            If e.OldItems IsNot Nothing Then
                TextBox3.Text = e.OldItems(0).ToString
                TextBox4.Text = e.OldValue
            End If
        End Sub
    End Class
  2. Jason Parrish
    Jason Parrish avatar
    92 posts
    Member since:
    Sep 2009

    Posted 15 Dec 2011 Link to this post

    This has been now recorded as bug.  Please vote it up to be resolved. 
Back to Top