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
Based on the provided snippet I have create a sample project to test the scenario. Using all the latest build from WebUI Studio 2009 R2 and northwind.mdf, already provided in the WebGrid sample, we could not replicate the issue. Attached is the sample project we use to recreate the scenario, the database and dll is not inculded to reduce the size of the attachment.
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.
I have just been informed by the developer that this feature has already been supported. You will need to set ColumnFooterAggegrateMode to CalculateAllData to calculate all the row using aggegrate count function.
Here is the snippet:
<ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="316px" UseDefaultStyle="True" Width="644px" DefaultStyleMode="Elegant" OnInitializeDataSource="WebGrid1_InitializeDataSource" DataSourceID="AccessDataSource1"> <LayoutSettings AllowEdit="Yes" PagingMode="ClassicPaging" PagingStyleUI="Slider" PagingSliderWidth="120" AllowColumnFreezing="Yes" AllowColumnMove="Yes" AllowFilter="Yes" AllowGrouping="Yes" AllowSorting="Yes" PagingDetectPartialGroupRows="True" ColumnFooters="Yes" ColumnFooterAggregateMode="CalculateAllData"> <FreezePaneSettings ActiveFrozenColumns="2" /> </LayoutSettings> <RootTable DataKeyField="OrderID"> <Columns> <ISWebGrid:WebGridColumn Caption="OrderID" DataMember="OrderID" DataType="System.Int32" Name="OrderID" Width="100px" AggregateFunction="Count" FooterText="Total: "> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="CustomerID" DataMember="CustomerID" Name="CustomerID" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="EmployeeID" DataMember="EmployeeID" DataType="System.Int32" Name="EmployeeID" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="OrderDate" DataMember="OrderDate" DataType="System.DateTime" Name="OrderDate" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="RequiredDate" DataMember="RequiredDate" DataType="System.DateTime" Name="RequiredDate" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ShippedDate" DataMember="ShippedDate" DataType="System.DateTime" Name="ShippedDate" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ShipVia" DataMember="ShipVia" DataType="System.Int32" Name="ShipVia" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="Freight" DataMember="Freight" DataType="System.Decimal" Name="Freight" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ShipName" DataMember="ShipName" Name="ShipName" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ShipAddress" DataMember="ShipAddress" Name="ShipAddress" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ShipCity" DataMember="ShipCity" Name="ShipCity" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ShipRegion" DataMember="ShipRegion" Name="ShipRegion" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ShipPostalCode" DataMember="ShipPostalCode" Name="ShipPostalCode" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ShipCountry" DataMember="ShipCountry" Name="ShipCountry" Width="100px"> </ISWebGrid:WebGridColumn> </Columns> </RootTable></ISWebGrid:WebGrid>
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.
As shown in the article Faster than “fastest ASP.NET Grid” and Faster than “fastest ASP.NET Grid” – Part IIWebGrid could handle large data using Paging and LoadOnDemand. The new sample is located in HyperFastWebGridWithLINQtoSQL
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);}
The GetSelectedRow in WebCombo javascript function will return a HTML element. In order to access the text in the cell you will need to use the getElementsByTagName javascript function. Here is the snippet to access the third cell text in the WebCombo selected row:
function getComboData() { var combo = ISGetObject('cmb'); var selectedRow = combo.GetSelectedRow(); var dateText = selectedRow.getElementsByTagName('TD')[2].innerText; alert(dateText);}
Since the dateText will be a string type, you will need further process to convert it to Date object for your scenario of comparing 2 Date object
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.
This feature is not supported yet in WebGrid. However using column footer and custom aggegrate function, you could show the total row of the table in the column footer. We have already provide an article titled "Walkthrough: Using Custom Aggregate function in WebGrid" in the WebGrid docs. In order to retrieve the total row in the table you will need to re-query the data since the WebGrid does not supply this information.
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>
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