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

Where condition in Radgrid Clientside using ADO.NET Data Service

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abdulaziz Bekr
Top achievements
Rank 1
Abdulaziz Bekr asked on 30 Jan 2014, 12:56 PM
Dear all

I create Entity Framework then I insert my table to it (Employee)

I can retrieve all data in Employee table using the following :

public class WcfDataService : DataService<CRMSEntities>
{
    // This method is called only once to initialize service-wide policies.
    public static void InitializeService(DataServiceConfiguration config)
    {

        config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
        config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
    }
    [WebGet]
    public int GetCount(string where)
    {
        return  String.IsNullOrEmpty(where) ? CurrentDataSource.Employee.Count() :
          CurrentDataSource.Employee.Where(where).Count();
    }
}


Aspx code

<ClientSettings>
       <DataBinding Location="../WcfDataService.svc"  SelectCountMethod="GetCount">
                    <DataService TableName="Employee"/>
       </DataBinding>
</ClientSettings>


My question is if i want to retrieve employee by id or by name How can i do that?

also if this method of client side is fast way to retrieve data from DB or there is another methods?

Thanks

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 30 Jan 2014, 05:37 PM
Hello,

Please try with the below link in this i have also attached Demo.

RadGrid with WCF Rest Service

Note : I have created two method, one of them for BindData in radgrid and another one for set the parameter.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Abdulaziz Bekr
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or