Not answered how can i attach a RadFilter to a RadGrid which is located in a user control

6 posts, 0 answers
  1. rashad kabbara
    rashad kabbara avatar
    25 posts
    Member since:
    May 2010

    Posted 30 Jun 2010 Link to this post

    i have a RadGrid in a usercontrol.
    i have an aspx page that contains the usercontrol and a RadFilter.
    how can i assign the FilterContainerID of the RadFilter to the RadGrid?

    i already tried to directly giving it the ID as such:

     

    <telerik:RadFilter 

    ID="rfCustomFilter" runat="server"FilterContainerID="RadGrid1"/>

    and i have also tried to assign filterContainerID in code behind as such:
    rfCustomFilter.FilterContainerID = "RadGrid1";

    both did not work, and i get an error when Adding an expression:
    Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

  2. SamJ
    SamJ avatar
    101 posts
    Member since:
    Jul 2008

    Posted 01 Jul 2010 Link to this post

    Hi,

    Indeed, you can try setting the FilterContainer property in the page code-behind for instance on Page_Load. But instead of hardcoding the grid ID as you did, try finding the RadGrid control and set the RadFilter property as below:

    RadGrid myGrid = <YourUserControl>.FindControl("RadGrid1"as RadGrid; 
    rfCustomFilter.FilterContainer = myGrid; 

    I hope this helps.

    SamJ
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. rashad kabbara
    rashad kabbara avatar
    25 posts
    Member since:
    May 2010

    Posted 02 Jul 2010 Link to this post

    it won't work since FilterContainer is read only and cannot be assigned to.
    any other possible solutions?

     

  5. SamJ
    SamJ avatar
    101 posts
    Member since:
    Jul 2008

    Posted 02 Jul 2010 Link to this post

    What about setting the FilterContainerID like this:

    RadGrid myGrid = <YourUserControl>.FindControl("RadGrid1"as RadGrid;  
    rfCustomFilter.FilterContainerID = myGrid.ID; 

  6. Kevin
    Kevin avatar
    2 posts
    Member since:
    Apr 2009

    Posted 10 Nov 2010 Link to this post

    I am in the exact same predicament.  Has anyone figured out a solution or a workaround?
  7. Devman
    Devman avatar
    3 posts
    Member since:
    Sep 2009

    Posted 21 Aug 2011 Link to this post

    I have the same problem. There are a some ideas?

    Thanks.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017