locked
Paging a grid with parameters RRS feed

  • Question

  • I have a page with a text box and load button and directly below that is a grid.  Users can enter a value in the text box and click load which will filter the results in the grid. 

     What I want to do is add a pager to the grid so users can page through the results of the filtered query.  I cant seem to get the parameters right on the pager.  Has anyone been able to get the pager working properly on a grid that is filtered?

    Tuesday, June 29, 2010 3:42 PM

Answers

  • AWESOME!  That was it, thanks for the help.

    Tuesday, July 6, 2010 11:25 AM

All replies

  • Hi,

    I created a sample which works well with a pager working on a datagrid which is filtered, please have a check:

    http://cid-1bf46693be07cfa6.office.live.com/self.aspx/.Public/Forum189187.zip

    Thursday, July 1, 2010 1:55 AM
  • Hmmm....I hooked my pager up just like yours and it still throws an error.  My filter is loading via a service which may be different than yours. Any thoughts?

    [RequiresAuthentication]public IQueryable<xsg_Company> GetXsg_CompanyByName(string startsWith)

    {

    return this.ObjectContext.xsg_Company.Where(e => e.Name.StartsWith(startsWith)).Where(e => e.Active);

    }

    Thursday, July 1, 2010 2:11 PM
  • Hi,

    What's the error you got? What if you add an OrderBy in your linq query, like this:

    this.ObjectContext.xsg_Company.Where(e => e.Name.StartsWith(startsWith)).Where(e => e.Active).OrderBy(e=>e.Name)

    Friday, July 2, 2010 1:03 AM
  • AWESOME!  That was it, thanks for the help.

    Tuesday, July 6, 2010 11:25 AM