This is a migrated thread and some comments may be shown as answers.

FilterChanging question

1 Answer 36 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jason Parrish
Top achievements
Rank 1
Jason Parrish asked on 14 Dec 2011, 03:48 PM
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
        Loop
 
        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

1 Answer, 1 is accepted

Sort by
0
Jason Parrish
Top achievements
Rank 1
answered on 15 Dec 2011, 04:28 PM
This has been now recorded as bug.  Please vote it up to be resolved.
http://www.telerik.com/support/pits.aspx#/public/winforms/8924 
Tags
GridView
Asked by
Jason Parrish
Top achievements
Rank 1
Answers by
Jason Parrish
Top achievements
Rank 1
Share this question
or