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
Earlier we used devexpress ...After executing following code the grid values automatically used to get stored in database table..
DataRow row = (DataRow)gvRequisition.GetDataRow(gvRequisition.EditingRowVisibleIndex);
{
enumerator.Reset();
row[enumerator.Key.ToString()] = enumerator.Value;
}
here "E.NEWVALUES" Gets a dictionary that contains the values of the non-key field name/value pairs in the row to be updated.
Now while using intersoft how can i get IDictionaryEnumerator object of gridchanges ...or a collection object of gridchanges to easily iterate through and assign values to database table
I have seen the sample provided by you on "batchupdate using custom object update" But as in the sample i can't create "custom.cs" files with so many fields as we are using too many tables and too many grids
I want a simple method like above ( iterating through enumerator and assigning values to row in datatable)You can also refer to email sent to technical@intersoftpt.com----
"changes in DAL? [IS-1C9B284D-4DF8-466E-B45B-8BC0D8A148E6] {99812}"
The following list shows additional methods to perform server-side related tasks.
The provided server side APIs, as described above, enables you to programmatically work against pending changes data that submitted from client-side.
Process pending changes programmatically and call your custom data access method to perform physical update.
This scenario is especially useful when you bind WebGrid to custom object collection instead of dataset or datasource control.
The following C# codes show how to use many of the server-side methods to iterate each change and update it using custom data access layer.
protected void WebGrid1_BatchUpdate(object sender, BatchUpdateEventArgs e) { foreach (WebGridRowChanges rowChanges in e.PendingChanges) { CustomObjects.Customer customer = null; try { switch (rowChanges.RowState) { case RowState.Added: customer = new CustomObjects.Customer(); MapChangesToObject(rowChanges.Data, customer); DataLayer.InsertCustomer(customer); break; case RowState.Modified: customer = DataLayer.GetCustomer(rowChanges.KeyValue.ToString()); MapChangesToObject(rowChanges.Data, customer); DataLayer.UpdateCustomer(customer); break; case RowState.Deleted: customer = DataLayer.GetCustomer(rowChanges.KeyValue.ToString()); DataLayer.DeleteCustomer(customer); break; } } catch (Exception exp) { // adds the Exception to batch update list to take advantage of WebGrid's partial errors support. WebGrid1.AddBatchUpdateException(new WebGridBatchUpdateException(rowChanges, new Exception("Record '" + rowChanges.KeyValue.ToString() + "' has error '" + exp.Message + "'", exp))); } } }
The following is the C# codes to map the changes into object.
private void MapChangesToObject(List<WebGridCellData> data, CustomObjects.Customer customer) { foreach (WebGridCellData cellData in data) { string newText = cellData.NewText; switch (cellData.Column.DataMember) { case "CustomerID": customer.CustomerID = newText; break; case "Address": customer.Address = newText; break; ... } } }
Codes explanation:
after execution of batchupdate event of webgrid,i am getting error "Can't find DataColumn with name "PSEUDO_LINE_ID" in the specified datasource" .When i debug i found that it exists in datatable "xpRequisition.dsReqOrder.xpReqDet".....
It also updates data in datatable but still shows the error "Can't find DataColumn with name "PSEUDO_LINE_ID" in the specified datasource"...I can't send you a simple sample as my project consists of devexpress dlls that are used in master page..Plz help me fed up with this error .....trying continuously since past two days....It's urgent....
protected void gvRequisition_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e) {
e.DataSource = xpRequisition.dsReqOrder.xpReqDet;//.dtReqdet;
UPdetails.Update();
MapChangesToObject(rowChanges.Data, TypeGuid);
gvRequisition.AddBatchUpdateException(new WebGridBatchUpdateException(rowChanges,
row = xpRequisition.dsReqOrder.xpReqDet.Rows.Find(strkey);
row[cellData.Column.DataMember] = cellData.NewText;
</ISWebGrid:WebGridColumn>--%>
Based on the error message, the process is interrupted because it can’t find data column with name “PSEUDO_LINE_ID” in the specified datasource. I used to suspect that you have different value specified in “Name” and “DataMember” property of WebGridColumn object, but the embedded WebGrid code proves me wrong.
I’d like to suggest you to add a breakpoint at the grid page’s code in order to determine the exact location where the error happens.
i have already mentioned that it happens after execution of batchupdate event of webgrid
Even if i comment the code inside batchupdate event of webgrid , this happens.."xpReqDet" is a datatable to which grid's datasource given.
I suspect that after batch update it may be searching column in dataset "dsReqOrder" instead of datatable "xpReqDet".How can i rectify the problem
I have also checked turning off the batchupdate feature then also same error occurs
Apologize for the delay in sending this.
I have sent a reply and enclosed a sample file to be evaluated at here. Please have the sample evaluated on your end and let me hear your feedback.
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