Control when the edition has finished in a DevExpress data-grid - datagrid

I am using AngularJS to implement a DevExpress control on my website. This control is of type dx-data-grid.
The control works perfectly but I run into a problem. In the mesh I have a series of records that I want to modify. I know how to control when editing starts (using the onEditingStart function) but my problem is that I do not know how to control when editing ends, because at that point I want to send the list to the server to modify it.
The View:
enter image description here
The function that controls the beginning of the edition is:
onEditingStart: function (e) {
console.debug("EditingStart");
},
Thanks!

I suggest you to use rowUpdating or rowUpdated event as per your requirement. At these events you can create list of records to pass to custom server side code.
If you require any further information then provide more information about the current implementation.
Hope this help

Related

Automatic Save Throughout ASP.NET Application? [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
ASP.NET Forms autosave
I'm looking for general guidance on how to implement an "auto-save" feature in ASP.NET 4.0. I have an application with a tabbed interface (AJAX Control Toolkit) and a user can make changes in a variety of fields and tabs at any given time. I need to create an auto-save for (1) every time changes are made to fields and (2) save everything every 3 seconds (or what not).
I've never implemented something like this and I'm looking for guidance one it. Obviously, I'm assuming that there's some AJAX involved, I just don't know how to go about it.
Use a web service with ASP.NET AJAX:
http://msdn.microsoft.com/en-us/magazine/cc163499.aspx
http://www.asp.net/ajax/documentation/live/tutorials/ConsumingWebServicesWithAJAXTutorial.aspx
http://encosia.com/using-jquery-to-consume-aspnet-json-web-services/
You ship off the data to the server using a web service. You can attach to the change event of the input control (or lostfocus event too), and when it fires, call the web service. For the every X seconds, use window.setTimeout or window.setInterval, and make the call to send all the pages data to the server.
I don't know if it will perform well by sending data that frequently; are you sure you need to do both?
An easy way would be to
Wrap autocomplete form in update panel
Attache .change() listeners to all textboxes ect
Add a javascript timer to the page
In the change event and timer click hidden button to post form back.
Maybe have some cute page has been saved text you update during the postback
Bam all done

How to review all datas in one pages in asp.net?

I have five pages in asp.net web application. I entered information in first page and click next. it goes to next page and enter information in this page. I continue this process for five pages. Before click Submit button in fifth page, I need to review once all information entered by me in all previous pages under review button click. How do this? pls Advice.
You can store your data in the database, as you move along the steps, and retrieve it in the final step. You can also store it in Session, as an alternative.
Surely there are other ways to implement this scenario, but the idea is to somehow persist the data and retrieve it in the final step.
I personally think that you are going the wrong way about this. Passing data from page to page is going to cause you all sorts of trouble.
There are a number of methods to achieve this on a single page. You could create 5 seperate controls and place them all on the single page (if they aren't all too big and slow down the page load), then make the appropriate control visible depending on which the user is to see. For example, when you click next make the current control visible property false and then display the next one. Then at the end of the process when you click complete you can access the entered data from each of the controls, you could create a fancy function in the controls that return you a populated class or even pass by reference (we won't go in to that here).
You could also look in to using Views. Which is another method that you could implement on a singular page.
If you're adamant with using multiple pages then you could temporarily store the data in a database and then on the final page get the IDs from a Session and store it all finally as one. But I wouldn't advise this, although it depends on the situation. If you want them to be able to fill half the form and then continue at a later date then the database method would be advisable, but if you only want data being stored upon completion then you will end up with a lot of half completed redundant data using this method.
The solution totally depends on the framework and methods you are using. I'll try and help you with an ASP.Net MVC3 solution, as I think MVC3 is really the way to go for when using ASP.Net.
When the user clicks on the 'next' button, just load a partial view (containing the next step html) with the JavaScript / jQuery Ajax method, OR just present the next step by using using the jQuery show / hide functions.
Keep your form data within one html form-tag (or at least one holder-div).
When you need to submit the information at the last step, simply collect the information with a single jQuery serialize call and send it to your ASP.Net receiver.
Some code snippets:
Display a partial view from the Razor view-engine:
#Html.Partial("/Views/Instance/_General.cshtml", Model)
Load a partial view through jQuery - for more details, please see http://api.jquery.com/category/ajax/
#Html.Partial("/Views/Instance/_General.cshtml", Model)
Post your data to the server though jQuery:
$("#submit-button-id").click(function () {
var data = $("#form-id").serialize();
$.ajax({
url: "/Example/Save",
type: "POST",
data: data,
cache: false,
success: function (success) {
if (success) {
// things worked out just fine..
}
else {
// present some kind of error..
}
}
});
});

ASP.NET - Refreshing GridView Data on Page After Button Click

I've been working with C# and .NET for quite some time now, but am currently working on my first ever web application with ASP.NET. It took me quite some time playing around to realize that the Page_Load function was getting called before my button event handler, though, at this point I've got the application working properly around this behavior. However, the issue I'm having is this:
I have a GridView control that is bound to a SortedList in my application. The button click event handler saves data in a form to the database (actually, saves data via a SOAP service), then updates the list that the GridView is bound to in order to reflect the most up-to-date data (again, updates the list from the SOAP service). However, because the page refreshes before my button click event handler fires, the data doesn't actually appear updated on the page. What is the proper way to handle a situation like this? How can I get the data on the page to be refreshed, or at least up-to-date, after the button handler saves data even though the page has already refreshed? I've been struggling with this for quite awhile now, so any code example or links that'll help explain this would be much appreciated.
Thanks in advance!
try inside Page_Load
if (!IsPostBack)
{
//Bind your Grid
}
just write your code in below if condition.
if(!IsPostBack)
{
write your code here in formload.
}
I want to correct Harag's link to the resource regarding the page lifecycle. It can be found here: http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx.
Though not an answer to the OP's question, I restate it because it's such an important concept to know once you start programming web forms on a more serious basis.

listview of ASP.NET(web application)

i have placed four textbox inside the listview of web application. if i enter data in first textbox, its corresponding record should be fetched from oracle database and fetched record should be placed in 2,3,4 textbox.
****TextBox.TextChanged Event
How to: Respond to Changes in a TextBox Web Server Control
Edit:
From your edit it would be better to use AJAX.
You can fetch data from oracle database from C# using the AJAX call and return the result to the response and display the data.
If you're using webforms you could use a WebMethod to invoke the query from javascript, you can see an example here.
You could also just add a control that invokes a function server side and use the FindControl method of the ListView to obtain the value of your textbox. Also if you want the function/method to be called when the user stops typing you could use a jQuery plugin called typewatch you can find it here. Also taking into account the WebMethod* attribute that I mentioned earlier in the answer.
Go through the article Complete ListView in ASP.NET 3.5. This article shows how to place textboxes inside listview and edit the data in listview.
For Oracle connection in ASP.NET this article Connecting to an Oracle Database Using ASP.NET—A Step-by-Step Tutorial will definitly helps you

ASP.net: How to handle events from dynamically added controls?

So I have a number of user control dynamically added to a page, and user interaction with these dynamically added user controls need to be handled by the control's parent.
Is this what is referred to as "event bubbling"?
How do I do that in VB?
Thanks in advance.
First, you have several complex issues here and my initial thought is that you should separate them and attack each on its own until you have it working and then add them into the final solution. For instance, don't try to start off by dynamically creating your user control and getting it to expose and fire an event. The dynamic part of this problem could get in the way and cause your events not to work but you would never know which is the problem. Instead my recommendation is you focus on events in VB.NET and getting them to work from a statically created user control. Then once you have this all working, move to making the user control dynamically created.
As far as understanding events in VB.NET, I highly recommend the MSDN samples. Start with this simple example: How to: Raise an Event (Visual Basic) and then follow through with the other samples that are linked to from that page. Then once you have learned creating your own events in VB.NET, then look into adding a usercontrol dynamically.
Event bubbling is when a parent control handles an event from a child. So, yes, this is what you are trying to do.
I am not sure of VB but in c# you can use following
id.event+=eventhandler yourEvent;
My first response to this kind of question is always this - why are you dynamically adding the controls? Could they go into a repeater (where this becomes a lot simpler), or must they be programatically handled?

Resources