AidanH
AidanH

Reputation: 522

Xceed Datagrid - Get filter row strings

Back again with more Xceed questions...

I want to be able to get the string values of the filter row (shown below):

enter image description here

The closest I've gotten is the following:

DataGridCollectionView.ItemProperties[columnIndex].FilterCriterion

Where 'DataGridCollectionView' is the current Xceed datagrid collection view. I have looked up the documentation for 'FilterCriterion', and you can set it to be whatever you want, but I see no obvious 'FilterCriterion.Value.ToString()' method or something similar. Any ideas how to read the values in the filter row of the Xceed data grid?

Upvotes: 2

Views: 911

Answers (1)

AidanH
AidanH

Reputation: 522

I got a reply from Xceed support, turns out you can get the filter row content like this:

You can access the FilterRow directly by getting a handle on it through it's Loaded event. For example:

<xcdg:DataGridControl ... >
    <xcdg:DataGridControl.View>
        <xcdg:TableflowView>
            <xcdg:TableflowView.FixedHeaders>
                <DataTemplate>
                    <xcdg:FilterRow Loaded="FilterRow_Loaded" />
                </DataTemplate>
            </xcdg:TableflowView.FixedHeaders>
        </xcdg:TableflowView>
    </xcdg:DataGridControl.View>
</xcdg:DataGridControl>

private FilterRow myFilterRow;
private void FilterRow_Loaded( object sender, RoutedEventArgs e )
{
    myFilterRow = sender as FilterRow;
}

You can then get the content of any FilterCell:

"myFilterRow.Cells[colIndex].Content"

Upvotes: 3

Related Questions