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
445
trigger rowadding event clicking a button outside of the grid
posted

Hello,

I have a webdata grid with a rowadding property.

At the top of the grid, I have a "save" button, so when I click this button, I would like to have exactly the same that when I press enter key.

So in other word, when I click on my "save" button, I would like to trigger the server side event "GridSpecBottom_RowAdding" for my grid GridSpecBottom.

Is it possible?

If not, how could I read values in this row?

I have tried

GridSpecBottom.Behaviors.EditingCore.Behaviors.RowAdding.Row.Items[0].Value.ToString()

but it returns null even if I have a data in my cell.

Thanks for your help

Parents
No Data
Reply
  • 6748
    Verified Answer
    posted

    Hello Damien,

     

    Do you want this Save button to do the job on the server? If this is not obligatory for you I am suggesting you your save button to be an html input field and to handle its onclick event:

    <input type="button" ID="Button1" OnClick="addRow();" Value="Save" />

     

    The addRow method should look something like this:

    function addRow() {

                var grid = $find("<%=WebDataGrid1.ClientID %>");

                grid.get_behaviors().get_editingCore().get_behaviors().get_rowAdding()._commitRow();

            }

     

    Regards,

    Lyuba Petrova

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

     

Children