locked
query string filtering without the filter control RRS feed

  • Question

  • User-2013179010 posted

    Ok this one should be fairly simple -  you know those ForeignKeyField links? They don't work when you remove the filter controls from the list page. Maybe that's obvious to everyone, it wasn't to me. Anyway I have a simple need to make those links work, but hide the filter control. For instance if I show a client their record, when they click the 'view contacts' link from there, I want them just to see their contacts, without a drop down showing them other clients to filter by. It seems however that if I take out the filters, even when I say DynamicDataManager1.RegisterControl(gridContacts,true); URL parameters have no effect. So, how do i do this?

    On a related note, it would be nice to be able to drop one of those ForeignKeyField type links elsewhere on my Clients custom page. I can't figure out how to do that however without databinding like a single row repeater and adding a row that binds to the Contacts field. Is there a quicker way?

    Monday, September 8, 2008 10:04 AM

Answers

  • User1641955678 posted

    You should be able to do this by using a DynamicQueryStringParameter in the <WhereParameters> instead of the DynamicControlParameter that points to the filter control.  An alternative that may be simpler is to just put Visible="false" on the filter control.

    To generate links, you can call MetaTable.GetActionPath().  It has various overloads for different situations.

    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 8, 2008 11:55 AM
  • User-2013179010 posted

     Ok link problem solved:

     

     <asp:hyperlink runat="<span" class="st">"server" ID="linkContacts" Text="Contacts" NavigateUrl='<%# ((MetaChildrenColumn)table.GetColumn("Contacts")).GetChildrenListPath(GetDataItem()) %>'></asp:hyperlink>
      

     much better. Thanks for the help david.

    
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 8, 2008 12:59 PM

All replies

  • User1641955678 posted

    You should be able to do this by using a DynamicQueryStringParameter in the <WhereParameters> instead of the DynamicControlParameter that points to the filter control.  An alternative that may be simpler is to just put Visible="false" on the filter control.

    To generate links, you can call MetaTable.GetActionPath().  It has various overloads for different situations.

    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 8, 2008 11:55 AM
  • User-2013179010 posted

    DynamicQueryStringParameter does not work

    A filter repeater with visible="false" however, does. Plus, added bonus that I can set it visible for admins I suppose so that's nice. Just woe betide if you try and put a value in the querystring that doesn't bind to something in your (invisible) drop down filters. There's probably a way to make that less fragile though.

    The MetaTable.GetActionPath() method however is something I'd already tried and failed at. What I need is the link to the current record's list from the other table, not just a link to the other table in general. Now sure I could construct it, with a GetActionPath("List"...) +"Customer.id="+Request["id"] or something hacky like that, but I was hoping for a way to get at the same thing that the ForeignKeyField uses. Currently I'm just using a repeater with a single DynamicControl, bound to the same datasource as the detailsview on the edit page. But this seems like a really roundabout way of getting a link to the current record's related records.

    Monday, September 8, 2008 12:46 PM
  • User-2013179010 posted

     Ok link problem solved:

     

     <asp:hyperlink runat="<span" class="st">"server" ID="linkContacts" Text="Contacts" NavigateUrl='<%# ((MetaChildrenColumn)table.GetColumn("Contacts")).GetChildrenListPath(GetDataItem()) %>'></asp:hyperlink>
      

     much better. Thanks for the help david.

    
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 8, 2008 12:59 PM