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

Distinct values limit in Grid

1 Answer 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
karthikeyan
Top achievements
Rank 1
karthikeyan asked on 16 Sep 2016, 05:29 AM

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

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 16 Sep 2016, 12:59 PM
Hello,

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.

Regards,
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.
Tags
GridView
Asked by
karthikeyan
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or