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'm using WebGrid Enterprise 7.0 in my project.
I created a WebGrid for users to set data in web page. The WebGrid loads data correctly. Users can change every cell in the WebGrid. After editing, user processes Save button. Then I save all the data in cells to database.
The way I get data is:
DataTable dt = this.wdgProjectRateSet.DataSource as DataTable;
My problem is: after I deployed the website to our IIS server, the result of the datatabe (dt) is the data before user changes it sometimes (which means the data is correct sometimes). When I debug the website in my computer, the data is correct all the time.
Hope someone can help me resolve it soon. Thank you very much.
Based on the description of the scenario as you mentioned in your initial post, I assume that you are about to create a WebGrid page which enable users to perform multiple edits across multiple tables in real-time without postback/callback. All pending changes will be submitted into server at once with a single event, thus eliminates waiting time and improves data editing experience. Is it correct?
If my guess is correct, then I’d like to introduce you to SmartBatchUpdate™ of WebGrid 7.
SmartBatchUpdate™ feature of WebGrid enabled your end user to make multiple changes to the data in the client side, while at the same time maintaining the changes as they navigate the data around. It employs pending changes concept to provide solid functionality and architecture for its batch update features. With the concept, every row that has changed since its first load will result in pending change.
A record row can contain only one pending change at a time, which is one of four modes below:
I believe that SmartBatchUpdate™ may improve the data operation process since it only process rows which have pending change status.
For more information regarding SmartBatchUpdate™ feature, please check in here. You can also check one of the live samples of SmartBatchUpdate™ feature in here.
Hope this helps.
Yes, we edit multiple rows in the client ,and then send to the server to save data .
Under the development ,the application run correct ,but when we deployed , we visit the application some error occur.
We capture some picture as attachment.
1, load data in the page_load event:
protected void Page_Load(object sender, EventArgs e) { LoadPriceSysList() }
/// <summary> /// Load data in the page_load event /// </summary> private void LoadPriceSysList() { wgrdView.DataSource = _contractfacade.GetPriceSysList(pricesys); wgrdView.DataBind(); }
2, add new row by click add button which from asp.net:
protected void btnAdd_Click(object sender, EventArgs e) { DataTable dt = wgrdView.DataSource as DataTable; if (dt == null) { DataTable newDT = new DataTable(); DefineDataTable(newDT); DataRow dr = newDT.NewRow(); dr["id"] = Guid.NewGuid(); dr["sys_id"] = pricesys; newDT.Rows.Add(dr); wgrdView.DataSource = newDT; wgrdView.DataBind(); } else { DataRow dr = dt.NewRow(); dr["id"] = Guid.NewGuid(); dr["sys_id"] = pricesys; dt.Rows.Add(dr); wgrdView.DataSource = dt; wgrdView.DataBind(); } }
3, save data by click save button which from asp.net:
DataTable dt = wgrdView.DataSource as DataTable; if (dt == null) { CommFun.Alert(VankeResource.pleaseTryAgain, this.Page); return; }
List<PriceSysList> lst_psl = new List<PriceSysList>();
if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { PriceSysList m = new PriceSysList(); m.id = dr["id"].ToString(); m.sys_id = hidsys_id.Value; m.out_name = dr["out_name"].ToString(); m.model = dr["model"].ToString(); m.brand = dr["brand"].ToString(); m.origin = dr["origin"].ToString(); m.quote_amount = TypeConverter.StrToDouble(dr["quote_amount"].ToString()); m.equiment_amount = TypeConverter.StrToDouble(dr["equiment_amount"].ToString()); m.install_amount = TypeConverter.StrToDouble(dr["install_amount"].ToString()); m.pipeline_amount = TypeConverter.StrToDouble(dr["pipeline_amount"].ToString()); m.profit_rate = TypeConverter.StrToDouble(dr["profit_rate"].ToString()); m.manage_rate = TypeConverter.StrToDouble(dr["manage_rate"].ToString()); m.remark = dr["remark"].ToString(); lst_psl.Add(m); }
List<PriceSysList> lst = lst_psl; int reint = _contractfacade.AddPricesysList(lst_psl); if (reint >= (int)CommEnum.sqlRetTips.success) { CommFun.Alert(VankeResource.SaveSuccess, Page); } else { CommFun.Alert(VankeResource.SaveFailed, Page); } }
4 , some error occur :
1): bind data lost
2): or exception from webgrid
I’d like to suggest you to load data in InitializeDataSource event. All codes related to the assignment of data source to the WebGrid component should be placed in InitializeDataSource event. Since in this event, an instance of DataSourceEventArgs can be obtained, so the assignment code should be: e.DataSource=dataSourceName;
The advantage of following this style is to utilize the advantages of WebGrid component extensively such as data caching feature is enabled if the assignment of WebGrid data source is placed in InitializeDataSource event.
Please try to place data source assignment in InitializeDataSource event and let us know the result.
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