Two questions in one really. I have a webtab on the page. On one of the tabs there is a ContentTabItem with DetailsView with Edit and Insert templates for various fields. There is a CommandField with Insert, Edit, Update and Cancel buttons. There is a separate button on the page to submit all data to the database.
How can I
a) Notify user if they have edited/inserted data in the contenttabitem using the commandfield buttons but haven't yet clicked the save/update/cancel commandfield button there to either discard or commit it to the objectdatasource the detailsview is bound to?
b) Automatically click the update button for them/commit their edit and continue on to my server side submission code afterward?
I hope that is clear.
Regards and thanks in advance.
Hello dougie ,
I’m just following up to see if you’ve been able to resolve your issue. If you have any questions or concerns or if you need further assistance please let me know.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://www.infragistics.com/support
I’m not really sure what you mean by any content item being edited at that time.
If you mean that you need to check if the DetailsView is in Edit/Insert mode, I don’t think the DetailsView has any built-in mechanism by which you can check that on the client side.
You would need to manually track its current state for example by adding a hidden button to the page that will contain the current state that you could set in the ModeChanging server side event of the DetailsView.
If the state is not Read-Only then the related buttons for Update/Insert/Cancel haven’t been clicked so it’s possible for changes to still not be committed, then you can programmatically click on the related anchor element (Update/ Insert/Cancel)in the DetailsView on the client side.
Developer Support Engineer II
http://ko.infragistics.com/support
When they click the submit button on the page (which is outside the webtab control).
In other words, when they try to submit data if they haven't yet committed changes I'd like to auto-commit those changes. There would not be a webtab or contenttabitem fired at the time. Basically what I need to be able to do is determine when the submit button (which is NOT in the command field in the webtab but is on the web page separately) is clicked if any contentabitem on the page isi in edit mode and if so to automatically commit that data as part of the submission process.
Thank you for posting in our forum.
In what event would you like to notify the users?
If you need to notify them when the selected tab is changed you can use the SelectedIndexChanging client side event of the WebTab control and show a confirm dialog.
Based on the selected option you can either cancel the selection changing ( set e.set_cancel(true) in the event) or you can programmatically click on the button: document.getElementById(“ButtonID”).click().
I’m looking forward to your reply.