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
George, I suspect that you don't use the correct settings in WebGridColumn for the html editing purpose. AFAIK, the ColumnType should be set to Custom and there could be more settings. Try to look at Handy's sample.
- James
Amanda, WebGrid produces very minimal viewstate which usually consist only the setting required to be persisted. If your Grid is created in design time (i.e, all settings are declared in aspx), you can even set ViewStateStorage to None. That way, WebGrid will not produce any view state at all and still fully functional.
Michael,
It appears that the OnBeforeXXX and OnAfterXXX for editing-type operations will be fired only in normal updating mode (non batch updating).
I think the reason is because batch update has its own specific events such as OnAcceptAllChanges, OnAddPendingChanges, OnUndoChanges and OnUndoAllChanges which supercede the basic editing events.
Hope this helps, James.
Aiyer,
Firstly, make sure that the always load cache on page load setting is set to false. The setting can be accessed in grid.LayoutSettings.AlwaysUseCachedDataOnFirstLoad.
Then, you should use grid.GetCachedDataSource() method in order to get the cached data source instead of .DataSource and cast it to appropriate datasource type.
Let me know if that helps.
- James.
Hello Eric,
After investigating your code further, it appears that you implement the ValueList in incorrect event. Instead of initializing the value list in PrepareDataBinding, you should place it in InitializeLayout event to ensure the value list is initialized when needed.
Code sample:
protected void WebGrid2_InitializeLayout(object sender, LayoutEventArgs e) { WebValueList vLang = null; WebGridColumn languageColumn = WebGrid2.RootTable.Columns.GetNamedItem("CultureCode"); if (languageColumn != null) vLang = languageColumn.ValueList; if (vLang != null) { // setup valuelist data vLang.DataTextField = "CultureCodeDescription"; vLang.DataValueField = "CultureCodeId"; if (!vLang.IsDataCached()) { DataTable dt = new DataTable("Languages"); SqlDataAdapter theLanguages = new SqlDataAdapter(); SqlConnection conn = new SqlConnection(SqlDataSource1.ConnectionString); try { string queryLangs = "SELECT CultureCodeId, CultureCodeDescription FROM Culture"; theLanguages.SelectCommand = new SqlCommand(queryLangs, conn); theLanguages.Fill(dt); } finally { if (conn.State == ConnectionState.Open) { conn.Close(); } } vLang.DataSource = dt; } } }
Let me know if that works for you.
Okay, will be waiting for your attachment.
Yes, I'm aware about the _moz input textbox. It appears to be used in the editing mode, which is internally used by the WebGrid. I also think hiding it would cause certain error in your web pages, which is not recommended.
It'll be great if you can reproduce the issue consistently in a simple webform, and attach it here. I'll help to look at your issue. Thanks.
It seems your previous WebGrid build has been quite old. There might be several enhancements related to transactions in the latest update.
You can see the solution for this issue in a similar community thread at http://www.intersoftpt.com/Community/WebGrid/Cant-delete-rows/
Hope this helps,James.
George,
Okay, I just realized that you're using OnTheFly configuration, which the Select in server-side may not be applicable (because the Grid wasn't refreshed in that case).
You can easily achieve this scenario by using ClientAction which maybe suitable in such OnTheFly context and for best performance. Here's how:
protected void WebGrid1_ButtonClick(object sender, ISNet.WebUI.WebGrid.ButtonEventArgs e) { SelectedObject selectedObject = WebGrid1.RetrieveClientLastSelectedObject() as SelectedObject; WebGrid1.ClientAction.InvokeScript("SelectRow", new FunctionParameter[] {new FunctionParameter((selectedObject.RowIndex + 1).ToString(), "number")}); }
Then in your ASPX, you have the following function in your scripts:
<script type="text/javascript"> function SelectRow(index) { var grid = ISGetObject("WebGrid1"); grid.RootTable.GetRow(index).Select(); } </script>
Thus, everytime the button is clicked, it'll select the row from the server-side call (which seamlessly call to the client-side to do the real operation). I have also attached a working sample for your convenience.
This is a much better solution instead of refreshing the entire Grid only to perform row selection which is very costly and results in slower response.
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