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
475
Adding Parent row on button Click Event
posted

Hi,

Am working with WHDG for the past 1 week and now i can able to set the values for the WHDG from dataset.I have a button outside of the grid on the button clicking event i want to add the new row to the grid.When i tried this what happening is during postback the exixting rows has been replaced with the newly added rows.

How can i add the new empty row(Parent Band) to the previously existing row.?

 

Thanks,

Hsakarp.

  • 15979
    Verified Answer
    posted

    Hello Hsakarp,

    You can use the following example function to add rows to the parent band:

    function AddRowToGrid() {
    var grid = $find("WebHierarchicalDataGrid1");
    var row = new Array(10000, 445, 0, 321);
    grid.get_gridView().get_rows().add(row);

    }

    This function should be executed on Client-Side.

    If you want to add records from Server-Side you will have to modify your Data Source by adding the record in it and then rebind the grid.

    I hope that this information will be useful.