How can I display all values in a Telerik GridViewCheckBoxColumn filter in a RadGridView?

StackOverflow https://stackoverflow.com/questions/14506656

Pregunta

When using a Silverlight GridViewCheckBoxColumn the filter displays only the distinct values of all currently viewed items (the whole grid is paginated). So if all items happen to have the value set to "false" the filter will only display "false". How can I change it so that both "false" and "true" are displayed?

The XAML for the column is:

<telerik:GridViewCheckBoxColumn 
         x:Name="processingFailureColumn"
         Header="{Binding ApplicationStrings.ProcessingFailure, Source={StaticResource ResourceWrapper}}"
         DataMemberBinding="{Binding IsErroneous}">

And the result looks like:

enter image description here

¿Fue útil?

Solución

I solved the problem by manually supplying the distinct values in the DistinctValuesLoading event of the RadGridView.

private void DatagridArchivesOnDistinctValuesLoading(object sender, GridViewDistinctValuesLoadingEventArgs e)
    {
        if (e.Column.UniqueName == "processingFailureColumn")
        {
            e.ItemsSource = new List<bool> {true, false};
        }
    }
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top