Distinct values limit in Grid

2 posts, 0 answers
  1. karthikeyan
    karthikeyan avatar
    24 posts
    Member since:
    Aug 2016

    Posted 16 Sep 2016 Link to this post

    Hi guys,

                 In telerik Grid the Distinct values in the filter By default, the distinct values that a column shows will be limited to the first 1000 distinct values that are visible in this column.

    But I don't want to set any limit to show the distinct values in the column I want all the available distinct values want to show for that column. I used the following code but it's not working for me please help me to come out from this issue.


    Private Sub OnRadGridViewDistinctValuesLoading(sender As System.Object, e As Telerik.Windows.Controls.GridView.GridViewDistinctValuesLoadingEventArgs)
     e.ItemsSource = DirectCast(sender, Telerik.Windows.Controls.RadGridView).GetDistinctValues(e.Column, False)
    End Sub

  2. Dilyan Traykov
    Dilyan Traykov avatar
    613 posts

    Posted 16 Sep 2016 Link to this post


    As stated in the Display All Distinct Values article, if you specify null (Nothing) for the Nullable(Int32) parameter of the GetDistinctValues(GridViewColumn, Boolean, Nullable(Int32)) method, then all distinct values will be returned. So, in your case, you should define the following event handler:

    Private Sub OnRadGridViewDistinctValuesLoading(ByVal sender As Object, ByVal e As GridViewDistinctValuesLoadingEventArgs)
                e.ItemsSource = DirectCast(sender, Telerik.Windows.Controls.RadGridView).GetDistinctValues(e.Column, False, Nothing)
    End Sub

    Please let me know if this works for you.

    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top