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
Hi,
I want to perform Batch Update in Hierarchical WebGrid when attaching WebGrid to CustomObjects.
Everything works fine accept that i want the DataKeyField of ChildTables and RootTable to AutoIncrement itself when user adds a new record into it.
The WebGrid doesn't seem to recognise the AutoIncrement property assigned to DataKeyField column and adds an empty string as id when adding a new rows. And i am not allowed to enter more then 1 record into the WebGrid due to empty string being given as DataKey on first row add.
This problem doesn't seem to occur in RootTable. Only ChildTables has this error.
Can you please tell what i am doing wrong here???
Note: I have attached the aspx file that i am using in which i am facing a problem and also i have attached a image file to display the error that i recieve while adding a new row.
Thanks,
Huzefa
Hi Huzefa,
Yes, I saw the attached image. As I said before, you will need to handle to select identity when insert a new row.I think no matter what you used, as long as you hadle to select identity which will retrieve the current increment id.
In our sample, we used the code below to handle it.
int? identity = this.SelectIdentityQuery(); OrderID = identity;
Here is the other article to do in Sql.
e.g try not to use BatchUpdate first. If you don't handle it, after you insert new row, try to remove the added row. It will surely return an error (incorrect id).
I see that you are using List as your strongly type custom object. I need to discuss to our developer if this is already supported or asked how to select identity in your scenario.It would be great if you can provide a simple runable sample. So when we debug it, we can know if it returns the correct id or not.
Regards,Handy
Please check 'New Identity Insert' documentation of WebGrid that related to auto-increment field and SmartBatchUpdate™ at here.I’m sure it helps.
I have gone through those articles. But they do not seem to help much in my case.
I must be doing something wrong while definign the columns or child tables.
Please have a look at my attached file and tell me what my be possible mistake i am doing.
One question.
Do you support Auto-increments in child tables?
Why there is no reply from your side???
Please let me try to help you. In you attached sample, there is nothing we can do because we don't have your database. As Yudi has mentioned, based on the article, you will need to handle to select the identity when insert new record.
We have a sample in WebGrid sample called BatchUpdate_Enterprise.aspx. In child table (orders), we hanlde insert and select the identity with DoInsert method.You can try to see the method in dsNorthwind_Extended.cs.
Hope this helps.
Hi handy,
Did u see the attached image file? The Auto-Increment is not happening at client side..
I am trying to do a batch update. The key is not getting incremented that's why its doesn't allow me to add more then one row..
We have a sample in WebGrid sample called BatchUpdate_Enterprise.aspx. In child table (orders), we hanlde insert and select the identity with DoInsert method.
This sample is not so useful in my case as i am doing batch update using strongly typed custom objects and this sample use DataSource controls.
I want a sample where there is a batch update in Hierarchical Mode using Strongly Typed Custom Objects??
Please help me out...
Hi Handy,
The above mentioned will be called when user has added few rows into the grid and then click the AcceptAllChanges button on WebGrid.
But in case i am not able to add more then one row into the ChildTables of webGrid.
I am handling the update of Identity key once the user submits the Grid for Update.
I will also create a sample and send it to you..
Yes, a simple runable sample which replicate the issue should help us to investigate this. n our sample, we could not replicate your issue. I know that the select identity should correctly run after you accept the changes. But while in batch update, it should be handled automatically. As I remembered I ever told you that you must not use List in AutoIncrement scenario.http://www.intersoftpt.com/Community/WebGrid/AutoIncrement-of-KeyField-giving-problem-when-record-already-exists/
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