user26850114
user26850114

Reputation: 11

Mudblazor datagrid - filterTemplate with templateColumn?

I have a requirement to add some HTML into the table cells so I am using TemplateColumn and CellTemplate to do this.

I have got sorting to work but how do I add filtering? At the moment it is not populating the dropdown lists.

When I was using PropertyColumn then filtering worked fine.

Filter icon shows default modal but empty drop down lists

<MudDataGrid T="Company" MultiSelection="true" Items="@companies" SortMode="SortMode.Multiple" Filterable="true" 
             Hideable="true">
    <Columns>
        <TemplateColumn Sortable="true" Filterable="true" SortBy="x => x.OrganisationName">
            <HeaderTemplate>
                Organisation
            </HeaderTemplate>
            <CellTemplate>
                HTML here
            </CellTemplate>
        </TemplateColumn>
     </Columns>
</MudDataGrid>

Upvotes: 1

Views: 594

Answers (1)

Rick
Rick

Reputation: 1

When you use the TemplateColumn with CellTemplate you want to enable the filtering you need to also add the FilterTemplate

Upvotes: 0

Related Questions