locked
Filtering with dropdown on columns RRS feed

  • Question

  • User-1556920591 posted

    Hi,

    I want to filter the records based on few columns on list view page. Columns have no dependency upon other tables/columns.

    How can i achieve such functionality.

    Wednesday, October 31, 2012 3:38 AM

Answers

  • User-330204900 posted

    if you have VS2012 (Add NuGet from Extension Manager) or VS2012 you can just open Package Manager (Right Click on References) and go to Online and type DynamicData in the Search box and select "Dynamic Data 15 Custom Filters" to your project then nave a look at the new filters added to you ~DynamicData/Filters folder.

    Then to use just add the FilterUIHint attribute to the column you want to filter by.

    i.e. C# [FilterUIHint("Names")] and VB <FilterUIHint("Names")>_

    That sould do it :)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 31, 2012 9:30 AM
  • User-330204900 posted

    With the current QueryableFilterRepeater you can only do a little with the layout see below:

    <asp:QueryableFilterRepeater runat="server" ID="FilterRepeater">
    	<ItemTemplate>
    		<span class="filter"><asp:DynamicFilter runat="server" ID="DynamicFilter" OnFilterChanged="DynamicFilter_FilterChanged" />&nbsp;</span>
    	</ItemTemplate>
    </asp:QueryableFilterRepeater>

    Here I have made the filters line up horizontally but that is the best you can do without doing some major lifting.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 1, 2012 9:46 AM

All replies

  • User-330204900 posted

    Hi Nkhurmi, try my filters from NuGet here Dynamic Data 15 Custom Filters

    Wednesday, October 31, 2012 6:49 AM
  • User-1556920591 posted

    Thanks. Can you please provide any sample where you have used the custom filters. It would be really helpful.

    Wednesday, October 31, 2012 9:06 AM
  • User-330204900 posted

    if you have VS2012 (Add NuGet from Extension Manager) or VS2012 you can just open Package Manager (Right Click on References) and go to Online and type DynamicData in the Search box and select "Dynamic Data 15 Custom Filters" to your project then nave a look at the new filters added to you ~DynamicData/Filters folder.

    Then to use just add the FilterUIHint attribute to the column you want to filter by.

    i.e. C# [FilterUIHint("Names")] and VB <FilterUIHint("Names")>_

    That sould do it :)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 31, 2012 9:30 AM
  • User3866881 posted

    Thanks. Can you please provide any sample where you have used the custom filters. It would be really helpful.

    Hi,

    I come here to see the state of the issue——if it's solved by MVP, please mark as an answer or just feedback;)

    Wednesday, October 31, 2012 8:33 PM
  • User-1556920591 posted

    Hi Decker,

    I am trying the resolution as suggested by steve. I will change the status once i done with my development.

    Thursday, November 1, 2012 3:55 AM
  • User-1556920591 posted

    Great Steve. Awesome solution provided. You saved my neck to cut Laughing.

    Just one more thing, can we realign the dropdownbox positions if i have more than one.

    Thursday, November 1, 2012 5:15 AM
  • User-330204900 posted

    With the current QueryableFilterRepeater you can only do a little with the layout see below:

    <asp:QueryableFilterRepeater runat="server" ID="FilterRepeater">
    	<ItemTemplate>
    		<span class="filter"><asp:DynamicFilter runat="server" ID="DynamicFilter" OnFilterChanged="DynamicFilter_FilterChanged" />&nbsp;</span>
    	</ItemTemplate>
    </asp:QueryableFilterRepeater>

    Here I have made the filters line up horizontally but that is the best you can do without doing some major lifting.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 1, 2012 9:46 AM
  • User-1556920591 posted

    Thanks Steve.

    Thursday, November 8, 2012 1:04 AM