Hi.
I am implementing a dxDataGrid in an application.
To be able to set row values at a New Row creation, I have changed the Wise.Web.Ext.DevExtreme Extension.
I have added the “initNewRow” Event to the dxDataGrid.cs Constructor and set its data map to the dxDataGrid.js:
case "initNewRow":
return {
data: args.data
};
In the application, I attached its Handler and it is being called properly. However, “e.Data” always comes null.
I need to set some default values to the newly created cell as documented here:
https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#onInitNewRow
Is this some sort of special event I should deal with in any different way?
Thanks in advance.
Ivan
See attached sample.
Hi,
I also need to be able to set default value for newly added row. Would you please, publish solution code for that?
Hi Luca.
Were you able to get that sample you mentioned earlier?
Cheers.
Ivan
Hi Luca.
Thank you!!!
I have attached a simple sample which shows a grid and a button to allow to add a New Row.
I have written some comments in the button Click, but basically, after adding the new row to the grid, I would like to set its cells with some default values. I have also added what I had tried and didn’t work.
A browser can send an event (an ajax request) to the server but if the event expects data back it has to be asynchronous. And certainly cannot change a C# object on the server and find the original javascrip map changed on the client.
The devexpress documentation and sample show a javascript event handler and an async ajax request getting data from an endpoint. You can do the same by adding the javascript code and request data from the wisej widget like it’s shown in our devex data samples using the getPostbackUrl() which automatically wires the request to the Widget’s WebRequest event – where you can return the data just like the devex docs show.
When you use the Wisej automatically wired events you can only send data to the server. Another option you have is to call a server side [WebMethod] from javascript and receive the return value in a callback (last argument) or using a Promise or the await keyword and calling the {MethodName}Async() version in javascript.
Please login first to submit.