Skip to content

Using a <Select> element in a Datagrid<FilterTemplate> #2520

Answered by stsrki
GilShalit asked this question in Q&A
Discussion options

You must be logged in to vote

Your Select type is TValue="int". While FilterContext SearchValue is object type. They must match.

<FilterTemplate>
    <Select TValue="int" SelectedValue="@(Convert.ToInt32(context.SearchValue))" SelectedValueChanged="@(e => context.TriggerFilterChange(e))">
        @foreach ( var v in valueDictionary )
        {
            <SelectItem TValue="int" Value="@((int)v.Key)">@v.Value</SelectItem>
        }
    </Select>
</FilterTemplate>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GilShalit
Comment options

Answer selected by GilShalit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants