iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
I'd like to use datatable from my dataset as datasource to loading WebGrid via WebService in clientside bind mode. I don't want to use LINQ.
I've tried (but without result)
[ScriptMethod] [WebMethod()] public ISDataTable GetJSONHAState() { DataSet1.WSS_HA_STATEDataTable dt = new DataSet1.WSS_HA_STATEDataTable(); DataSet1TableAdapters.WSS_HA_STATETableAdapter da = new DataSet1TableAdapters.WSS_HA_STATETableAdapter(); da.Fill(dt, 0); return DataTableConverter.ConvertFrom(dt); }
da.Fill(dt, 0);
Could you give me some example ?
regard
Andrzej
I have discussed this issue with the developer, this feature has not been supported in the current build of WebGrid 7.
However, the next build of WebGrid 7 will be enchanced to include this feature.
The next build of WebGrid 7 will support this feature which will be released in a few weeks. Here is a snippet of the GetData function:
[WebMethod]public Object GetData(DataSourceSelectArguments selectArguments){ SqlCommand retrieveComm = new SqlCommand(); retrieveComm.Connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SqlNorthwindConnectionString"].ConnectionString); retrieveComm.CommandText = "SELECT TOP 15 * FROM [Products]"; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = retrieveComm; DataTable dtTemp = new DataTable(); da.Fill(dtTemp); if (selectArguments.OperationType == SelectOperation.SelectData) { ISDataTable isTable = DataTableConverter.ConvertFrom(dtTemp); return isTable; } else if (selectArguments.OperationType == SelectOperation.SelectCount) return dtTemp.Rows.Count; throw new InvalidOperationException("Unsupported operation type!");}
Here is the snippet of the WebGrid client binding property:
<ClientBindingSettings DataLoadMode="PagedData" DataSourceType="WebService" ServiceUrl="CustomService.asmx"> <ServiceMethods SelectMethod="GetData" /></ClientBindingSettings>
It is very similar with the snippet code you posted
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname