Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
How to add new row in webdatagrid?
posted

How to add a new row to webdatagrid in infragisitcs V21.2?

Please help me!!!

Thanks in advance!!

Parents
No Data
Reply
  • 1660
    Offline posted

    Hello Prakash,

    In case you are using Auto CRUD for your WebDataGrid (the default behavior), then you would have 3 options for adding new rows. Adding the row via the client-side, adding via the server-side or adding the new row with the RowAdding UI.

    To add the row with JavaScript code, the rows collection of the grid should be accessed and new rows should be passed as an array, where each element should correspond to each cell value of the row.

    Adding a row in server side is similar as well, the data source needs to be accessed and new row needs to be added there, after that the data source needs to be set again to the updated data source and the grid should be rebound.

    To add a row through the UI, please review the following page in our documentation which provides a detailed explanation of how to achieve this. Additionally, there is a sample that demonstrates the use of the RowAdding UI here.

    In case you are using Manual CRUD you can refer to the following blog that provides an example of implementing manual CRUD.

    I have also prepared a small sample that demonstrates the row adding using both the client-side and the server-side code.

    Please test the sample on your side and let me know if you have any questions.

    Regards,
    Ivan Kitanov

     

    AddRowOnButtonClick.zip

Children
No Data