May 29, 2010, 3:13 PM
[CLOSED] [1.0] Store of WebService HttpProxy with DataTable Paging
hi,
I failed to make use of the example that use generic-handler to load the store "custom search" with Paging<T>...
I have WebService that Return Already Paged DataTable object from the BusinessLogicLayer but the store reader or something else doesn't understand the dataTable.
as I said Paging Object make no sense since its make paging in the server side after fetching all records from DB "this is how i understood it so far". so how i can accomplish that...
here is some code snippets:
thanks,
I failed to make use of the example that use generic-handler to load the store "custom search" with Paging<T>...
I have WebService that Return Already Paged DataTable object from the BusinessLogicLayer but the store reader or something else doesn't understand the dataTable.
as I said Paging Object make no sense since its make paging in the server side after fetching all records from DB "this is how i understood it so far". so how i can accomplish that...
here is some code snippets:
[WebMethod]
public DataTable LoadComboBoxData(int start, int limit)
{
var db = new DBFactory("Currencies");
var resultColumns = new List<string>();
resultColumns.AddRange(new[] { "currencyId", "currencyName" });
db.LoadListData(false, start, limit, resultColumns);
//return db.TotalRecordCount;
return db.DefaultView.Table;
}
the webservice return the recodes correctly but I need to return the TotalRecordCount beside the dataTable how I can do that??/// <summary>
/// Creates Json reader for the store. It will updated, so that any type of reader could be used by store
/// </summary>
private void CreateJsonReader()
{
//Create reader for store
JsonReader reader = new JsonReader();
reader.IDProperty = this.ValueField;
reader.Fields.Add(this.ValueField);
reader.Fields.Add(this.DisplayField);
if (this.HasAdditionalStoreColumns)
{
var fields = from column in this.AdditionalStoreColumnsArray
select new RecordField { Name = column };
reader.Fields.AddRange(fields);
}
//reader.TotalProperty = "RecordCount";
this.DataStore.Reader.Add(reader);
//ToDo: Exception Management
}
this.DataStore.ID = string.Format("{0}_defaultStore", this.ID);
this.DataStore.AutoLoad = this.AutoLoad;
this.Controls.Add(this.DataStore);
this.StoreID = this.DataStore.ID;
this.LoadingText = "refreshing ...";
//ToDo: Implement Sorting and Direction.
//gridStore.RemotePaging = true;
//gridStore.RemoteSort = true;
this.DataStore.AutoLoadParams.Add(new Parameter("start", "0", ParameterMode.Raw));
this.DataStore.AutoLoadParams.Add(new Parameter("limit", "5", ParameterMode.Raw));
// Create Proxy
HttpProxy storeProxy = new HttpProxy();
storeProxy.Method = HttpMethod.POST;
storeProxy.Url = "http://localhost/test/Services/GenericService.asmx/LoadComboBoxData";
this.DataStore.Proxy.Add(storeProxy);
it'll be nice if you could change/tune the planets example to full-fit my requirements.thanks,