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
I follow the "ms-help://ISNet.WebUI.WebGrid.V6/ISNet.WebUI.WebGrid/Loading child rows on demand based on the selected parent row.html" help article to try use ISDataSource, but get the below error:
ISDataSource 'ISDataSource1' Table [Orders] could not find a non-generic method 'GetDataBy' that has parameters: CustomerID.
In 9 step
9 Open ISDataSource Designer
I not know set whick table's SelectChildRowMethod, now i set the Orders SelectChildRowMethod to GetDataBy. Is right?
And how to set the parameters if database is MS SqlServer Or Oracle? the sample is all .mdb file data source. I think the ISDataSource is wonderful control, it can increase webgrid performance if binding Hierarchical data. but the help information not enough to use it.
Regard
Step 2 to 7 in the walkthrough has already detailed the requiredsteps to create the new GetDataBy query. Following all the steps in the article does not produce any error in my environment.
For MS SqlServer or Oracle, you should modify the query in the article to:
SELECT CustomerID, EmployeeID, Freight, OrderDate, OrderID, RequiredDate, ShipAddress, ShipCity, ShipCountry, ShipName, ShipPostalCode, ShipRegion, ShipVia, ShippedDate FROM Orders WHERE (CustomerID = @CustomerID)
Thank you for your help, It can work now. but i have other question. I just want to use ISDataSource Binding Hierarchical Data, But Insert, Update, Delete Action i use webgrid_AddRow, webgrid_UpdateRow, webgrid_DeleteRow Method, But now get below infomation:
"Updating is not supported by ISDataSource 'xxx' Table [aaa] unless the UpdateMethod is specifed"
how can i do? can you gave me a sample?
You will need to use the AddRow server side event handler for such scenario. It is not recommended to use this method to update the datasource. During the AddRow event handler, you could manually called the logic to handle the database operation and afterward, you will need to set the RetrunValue to false and invoke the RefreshGrid functionality to refresh the Grid data from the Database again.
Here is the snippet for AddRow server side event handler:
protected void WebGrid1_AddRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e){ if (e.Row.Table.Name == "Customers") { DataRow drCust = (DataRow)e.Row.DataRow; dsNorthwindTableAdapters.CustomersTableAdapter dtCust = new dsNorthwindTableAdapters.CustomersTableAdapter(); dtCust.Insert(drCust["CustomerID"].ToString(), drCust["CompanyName"].ToString(), drCust["ContactName"].ToString(), drCust["ContactTitle"].ToString(), drCust["Address"].ToString(), drCust["City"].ToString(), drCust["Region"].ToString(), drCust["PostalCode"].ToString(), drCust["Country"].ToString(), drCust["Phone"].ToString(), drCust["Fax"].ToString() ); e.ReturnValue = false; WebGrid1.ClientAction.InvokeScript("RefreshGrid()"); }
Here is the snippet for the RefreshGrid client side function:
<script type="text/javascript" language="javascript"> function RefreshGrid() { var grid = ISGetObject("WebGrid1"); grid.Refresh(); }</script>
I have recieved your response through technical@intersoftpt.com
Please use the InsertCode functionality if you would like to insert some code snippet. You could also send your code as an attachment.
Regarding your questions:
Based on the scenario you are trying to do, have you consider using ISDataSource with custom object, we have already provided a sample for hierarchical custom object with ISDataSource in the BindtoHierchicalCustomObject.aspx
If not, do you mind sending us a sample project in order to help us replicate the issue easily.
attachment is my sample.
WebGrid version is 6.0.7200.218
ISDataSource versiont is 1.0.1500.210
ISFramkwork is 3.0.5000.705
please read the readme.txt first then checked. thanks.
It seems the issue is caused because WebGrid is still using the previous cache data. In order to solve the issue, you could manually clear the cache during every addrow in the InitializePostback server side event. You will also need to invoke the WebGrid refresh client side event.
Here is the snippet for initialize postback event handler:
protected void wgStorage_InitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e){ if (e.Action == PostBackAction.AddRow) { isdsStorage.Tables.GetNamedItem("TShelf").ClearCacheAndData(); wgStorage.ClientAction.InvokeScript("GridRefresh()"); }}
Here is the snippet to refresh the WebGrid from the client side:
function GridRefresh() { setTimeout(function() { var grid = ISGetObject('wgStorage'); grid.Refresh(); }, 5);}
This issue has also been acknowledge by our developer as bug. A bug report has been cerated for this issue. The above solution will work as a temporary workaround while a permanent fix is being worked on. We will inform you if there is any update or progress regarding this issue.
I can set EnableCaching = No to avoid this issue now, but the other question "smaple2.aspx file, after add new shelf, then immediately do update or delete operate, then get some error. ". how can i solve this issue. Thanks.
Regards
I could not replicate the issue in our environment using all the latest build ISDataSource build 211 and WebUI Framework build 750.
Setting the EnableCaching to No does not produce an error after updating or deleting right after an insert operation.
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