locked
FilterRepeater specify linked columns RRS feed

  • Question

  • User-725790043 posted

    Hi, I want to specify which linked columns i want to display in the filter repeater, how do i do this?

    Wednesday, September 24, 2008 12:49 AM

Answers

  • User-330204900 posted

    Hi Ferds, a quick and easy way would be to handle the FilterRepeater's ItemDataBound event and decide in there whether you want a Filter or not:

    protected void FilterRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
    	var column = e.Item.DataItem as MetaColumn;
    	if (column != null)
    	{
    		if (column.Name == "Shipper")
    			e.Item.Visible = false;
    	}
    }
    Hope this helps [:D]
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 24, 2008 4:26 AM
  • User660823006 posted

    You can also look at the Filter attribute from our Future project (http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14475). It allows you to place metadata on the model to determine if a column is displayed as a filter or not.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 24, 2008 12:39 PM

All replies

  • User-330204900 posted

    Hi Ferds, a quick and easy way would be to handle the FilterRepeater's ItemDataBound event and decide in there whether you want a Filter or not:

    protected void FilterRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
    	var column = e.Item.DataItem as MetaColumn;
    	if (column != null)
    	{
    		if (column.Name == "Shipper")
    			e.Item.Visible = false;
    	}
    }
    Hope this helps [:D]
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 24, 2008 4:26 AM
  • User660823006 posted

    You can also look at the Filter attribute from our Future project (http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14475). It allows you to place metadata on the model to determine if a column is displayed as a filter or not.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 24, 2008 12:39 PM
  • User-1005219520 posted

    If you'd like to automatically exclude all FK columns that have too many entries, take a look at my blog on How to: Limit Foreign Key entries and drop down width in the filter repeater

    Thursday, September 25, 2008 2:05 PM