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
In the webgrid blinding with the webservice sample, it show me how to bind it with the linq object.
Is it possible that to blind with xml or datatable?
Yes, it is possible to bind with XML or DataTable.
I added a WebMethod called GetCustomers to my WebService sample.
[WebMethod] public object GetCustomers() { DataTable dt = new DataTable(); dt.Columns.Add("ContactTitle", Type.GetType("System.String")); dt.Columns.Add("CustomerID", Type.GetType("System.String")); dt.Columns.Add("ContactName", Type.GetType("System.String")); dt.Rows.Add(new object[] { "Owner", "ALFKI", "Maria" }); dt.Rows.Add(new object[] { "owner", "ANATR", "Ana" }); dt.Rows.Add(new object[] { "oWner", "ANTON", "Antonio" }); dt.Rows.Add(new object[] { "Sales Representative", "AROUT", "Thomas" }); dt.Rows.Add(new object[] { "Sales Manager", "BERGS", "Christina" }); dt.Rows.Add(new object[] { "Sales manager", "BLAUS", "Hanna" }); IList<Class1> items = dt.AsEnumerable().Select(row => new Class1 { title = row.Field<string>("ContactTitle"), id = row.Field<string>("CustomerID"), name = row.Field<string>("ContactName") }).ToList(); return items; }
Where the Class1 is defined as follow.
class Class1 { public string title; public string id; public string name; }
I can show the Customers in WebGrid by using the following snippet code.
<ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="600px" RenderingMode="HTML5" Width="800px" BindingOperationMode="ClientBinding" ViewStateStorage="None" StateRestorationLevel="Low" UseDefaultStyle="True"> <RootTable> <Columns> <ISWebGrid:WebGridColumn Caption="Contact Title" DataMember="title" Name="ContactTitle" Width="200px" CaseSensitiveGrouping="No" /> <ISWebGrid:WebGridColumn Caption="Customer ID" DataMember="id" Name="CustomerID" Width="100px" /> <ISWebGrid:WebGridColumn Caption="Contact Name" DataMember="name" Name="ContactName" Width="100px" /> </Columns> </RootTable> <ClientBindingSettings DataSourceType="WebService" ServiceUrl="WebServiceforClientBinding.asmx"> <ServiceMethods SelectMethod="GetCustomers" /> </ClientBindingSettings> </ISWebGrid:WebGrid>
Hope this helps.
Thanks, In this case, whats the ItemTypeName value should be ?
In my opinion, The ItemTypeName value should be Class1.Hope this helps.
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