Aspxgridview1rowupdating what is your intention dating
The main goal for this time is to add inline editing functionality to the grid, in order to be able to update the imports and manage adding, editing and removing credit cards.However we will add also a couple more enhancements in order to show the potential of the grid and offer benefits to the end users.I will not waste space in this post so I will show you only what you would need to add.public static bool Remove Import(int credit Card Id, int year, byte month) public static bool Add Import(int credit Card Id, int year, byte month, decimal import) public static bool Update Import(int credit Card Id, int year, byte month, decimal import) This is it.In case the user hits Escape key (27) we will just get out of the edit mode by calling Cancel Edit method.Once Update Edit is called a callback will be generated and the Row Updating server side method will be executed, in which we will need to handle the persistence of the data.Still I will let you discover them and invent new ones.We are going to make our row editable on double click and in order to achieve that we will write down a function (in Java Script) that is going to be associated to the grids client side event called Row Dbl Click. At first we will add in our ASPX file, inside the grid definition a new section that is called Client Side Events (as we already did for other controls) and it will look like: It is that simple!
We will receive the old values that (of interested updating columns) and the new one that were chosen by the user, in a form of Ordered Dictionaries, exposed by two properties in our event argument.
Because of this, we have our edit controls in read only state.
You can find on Devexpress support web site several issues that are speaking about this behavior and why of it. Define the following server side event: What we defined here is checking if the cells that are going in edit mode are the one we are aiming to put in edit (not the Name and Total columns) and if so we are setting a couple of properties.
In this post we will continue adding functionality on our previous example.
If you missed my previous post you can get it here: ASPx Grid View Excel style – Adding notes to grid cells.I will not go in the detail about the environment and developing requirements, if interested jump op to my other posts.