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
640
Extra RowUpdating fired for last cell in last row of grid
posted

Hello,

When you try to edit  last cell in last row of WebDataGrid and then leave this cell with some changes made there's a postback executed (it is caused by unnesessory triggering of "TriggerCommit" event) which is not executed for the cells above of same column and any other cells in the last row.

To repoduce do following:

1 -add grid to page

2 - make last column editable

3 - do not enable Activation Behavior to enable switching between rows without posbacks

4 - double click on any not last cell of last grid column and edit value (see that lost of focus doesn't trigger "TriggerCommit" event)

5 - double click on last cell of last row, edit value and leave this edit box by clicking anywhere on the grid

6 - Misterious "TriggerCommit" is fired and all made changes are lost


I cannot tell any more details about triggering of "TriggerCommit" event as there's no actual callstack for it.


This event is side effect of

/* VS 05/15/2009 Bug 17637. Scrollbars in Firefox do not take focus away from editor */
/* remove scroll listeners from containers of grid */

var i = this._scrollDIVs ? this._scrollDIVs.length : 0;

while (i-- > 0)

          $removeHandler(this._scrollDIVs[i], 'scroll', this._stopEditHandler);

in

exitEditMode: function (update)

method.

That is all I know for now.

Can some one help? This extra event trigger prevents my application fro runniing correctly.

I'm using 10.3.20103.2217 version of control.

 

UPD: Can this be a reason of descripbed behavior?

/* OK 4/22/2011 73459 - Update of the last row of the grid does not fire RowUpdating Event */
_forceUpdateCommit: function ()

  • 640
    posted in reply to Hristo

    Hello,

    Sample attached please set path to cust.xml here

    ds.ReadXml("c:\\cust.xml", XmlReadMode.ReadSchema); (line 124 in LastUpdatable.aspx.cs)

    according your local environment.

    To reproduce:

    1 - Open LastUpdatable.aspx in any browser (I tried IE 9 and FIrefox 13)

    2 - Press Edit button to switch grid into edit mode

    3 - Edit values in CustNum columns in all rows except last one. See values save changed state when you edit it and switch to another row

    4 - Try to edit value (you must change it) of CustNum column in the last row.

    5 - Click on any other row. See postback and all values reset to initial state. This should not happen.

    There's a workaround for this behevior in attached sample. Uncomment this

            //col = new TemplateDataField
            //{
            //    Key = "__wondercolumn_to_prevent_last_cell_last_row_edit_failure__",
            //    Width = 0
            //};
            //col.Header.Text = "";
            //this.grid1.Columns.Add(col);

    in MakeGrid() and step 5 will not fire PostBack.

    How can I avoid this PostBack without adding empty column?

    My main goal is to implement multirow update using WDG for .NET 3.5.

    .NET 3.5 is requirement. I cannot migrate to .NET 4.0

    Regards,
    Andrey

  • 8160
    posted

    Andrey,

    I followed your steps and tested this but WDG works normal. I tested it under IE8/IE9. Could this be a browser specific issue?

    Maybe if you provide me with sample I will reproduce it.

    Thank you

  • 8160
    posted

    Hi Andrey,

    I will look into this and will update you after I have more information.