Hello:
I adopt Netadvantage Asp.Net 2009 V2 and I want my webgrid to accomplish below function:
1. add new row in the grid.
2. Check the new row data is correct or not ? if it was not correct therefore the grid would not allow to add new row.
3. view the grid with paging function.
Originally I complete first item by enable DisplayLayout "AddNewRow function" and put the grid in a updatepanel to achieve ajax function.
I also follow the help manual section "Using XML Load -On -Demand " to view the grid with paging function. But I found that after I complete the paging function by waye of the help manual's suggestion the original "AddNewRow function" did not work anymore.
My problem is as below:
1. Did it mean I can not use updatepanel and grid "XML Load -On -Demand " together?
2. How to remove the new row added in the grid by way of "AddNewRow function" as soon as I found the row data violate regulation.
Any suggestion is welcome.
Sincerely,
Daniel Lee
Hello Daniel,
It is recommended to you use Load on Demand feature without Update panel this is due to the fact that the grid use AJAX internally and the grid does not need of Update panel. You can use UltraWebGrd with Update Panel when the grid is in Batch mode.
You can take a look at the out of the box AJAX functionalities of the UltraWebGrid.
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.2/CLR3.5/html/WebGrid_AJAX_Functionality.html
About your second question, I am not sure how you implement validation. You can Implement validation On client-side or on the server-side. If want ,to remove the new row with client-side code you can use CSOM (Client - side - object - model) more information you can see here:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.2/CLR3.5/html/WebGrid_Rows_Object_CSOM.html
For example:
function removeRow() {
var grid = igtbl_getGridById('gridId');
grid.Rows.remove('index of the row from the collection');
}
Hi Rado:
I got it. If I want to trigger updaterow server event in ajax status I need to leave the edited row and click other place not as just press "enter" key as before.
Daniel Lee 2009/12/10
Hello Rado:
Yes. You reply my second question.
I checked the AJAX help but still confused how to triger server update event. In my case I query database and show data on webdatagrid which is asp.net control not ajax control ; I also adopt load on demand and enable pager function. The data display and paging function work well but the problem is that when I click one cell and edit the cell's value the UpdateCell server event was not been triggered.
My another case adopt update panel with webdatagrid and the updatecell server event could be triggered well. That case I did not adopt paging function but I want to change it to within paging function therefore I enable the webdatagrid 's load on Demand function and grid's paging data display is ok. Only the problem is that my former updatecell server event and updaterow server event did not be triggered any more.
Is there any solution or sample code?
Regards,
Daniel