This is a migrated thread and some comments may be shown as answers.

Binding grid to Membership Users

1 Answer 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
plusHR
Top achievements
Rank 1
plusHR asked on 19 Apr 2011, 03:41 PM
Hi.

We have over 5000+ users in our asp membership database and we finding that when binding this to the radgridview that the query times-out. The inital query is calling the Membership.GetAllUsers but this is what is causing us problems.

public IQueryable<MembershipServiceUser> GetWebUsers()
        {
            return Membership.GetAllUsers().Cast<MembershipUser>().Select(u => new MembershipServiceUser(u)).OrderBy(o=>o.UserName).AsQueryable();
        }


 I have seen that you can call this with PageSizes and the query could read something like this; However I have adjusted the pagesize in the query but with no result;

#region Administration functions
 
       public IQueryable<MembershipServiceUser> GetWebUsers(int pageIndex, int pageSize, out int totalRecord)
       {
           return Membership.GetAllUsers(pageIndex, pageSize, out totalRecord).Cast<MembershipUser>().Select(u => new MembershipServiceUser(u)).OrderBy(o => o.UserName).AsQueryable();
       }

<riacontrols:DomainDataSource x:Name="MyData"
                                     QueryName="GetWebUsers"
                                     AutoLoad="True"
                                     PageSize="200"
                                     LoadedData="MyData_LoadedData">
           <riacontrols:DomainDataSource.DomainContext>
               <ds:UserRegistrationContext />
           </riacontrols:DomainDataSource.DomainContext>
       </riacontrols:DomainDataSource>

Can you tell me how I can get the grid to pass in the page sizes etc so that we can get the list of login accounts quicker and without having a time-out in the wcf service returning the results.

Thanks
P

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 20 Apr 2011, 07:54 AM
Hello Paul,

I Believe that the .GetAllUsers() invocation is breaking the code since it will get all users no matter what. You should skip this step and simply apply your OrderBy condition. For example:

 

public IQueryable<MembershipServiceUser> GetWebUsers()
        {
            return Membership.OrderBy(o=>o.UserName).AsQueryable();
        }


Greetings,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
plusHR
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or