Ticket T757657
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

TreeList - CellValueChangedEventArgs is always FocusedColumn in the CellValueChanged event

Issue with E443 ("TreeListEditor - How to enable in-place editing ") since upgrading to 19.1 - maybe a bug in TreeList

created 6 years ago

Hello!

I use the TreeListInplaceEditViewController from E443. I just upgraded the application from 17.1.4 to 19.1.4 and now suddenly get errors in that controller.

The problem is that treeList_CellValueChanged gets called when the TreeList is initialized (in an XAF-ListView) and the event data that is sent to event handler (from TreeList) seems faulty. In my crash case the event data e.Column is a "Name"-column but the e.Value is a bitmap. This finally leads to an conversion error in the event handler (in the call of focusedColumnMemberInfo.SetValue( …)).

When I debugged into TreeList.OnSetValue method (which finally triggers CellValueChanged event) I found out that the columnID parameter there was (so far correctly) of an Icon column in my business object and therefore the val parameter was correspondingly a bitmap. But the obvious problem in this method then seems to be the following event triggering call:

C#
RaiseCellValueChanged(new CellValueChangedEventArgs(FocusedColumn, node, val));

So the reason why I get faulty event values is that here "FocusedColumn" gets passed (which in that case is not the "Icon"-column but the "Name"-column).

Isn't this a bug?

Furthermore do you have a good idea how I could prevent that all the code in treeList_CellValueChanged is executed when the TreeList is initialized or refreshed. The code in that handler only makes sense when a user manually edited a TreeList cell? My solution and workaround to all of this so far is that I set a flag in treeList_ShownEditor and the treeList_CellValueChanged code is only executed when that flag was set before. Maybe this is good enough.

Regards,
Johannes

Show previous comments (4)
M M
Martin Praxmarer - DevExpress MVP 6 years ago

    See here Johannes - the problem with the focusedcolumn should also be fixed i think:

    https://www.devexpress.com/Support/Center/Question/Details/T752283/treelist-cellvaluechangedeventargs-is-always-focusedcolumn-in-the-cellvaluechanged-event

    all in all that change in an minor release was really heavy…

      Thanks, Martin. Seems that I am just ruminating a bunch of tickets ;-)
      When I think that I upgraded the application from 17.2.5 and the nearly only and most breaking change was introtuced in a minor version then I fully agree with the "heavy" label.

      DevExpress Support Team 6 years ago

        Thank you for your feedback. Please inform us of your results once you have had the opportunity to test your project with the hotfix or the next maintenance update.

        Answers

        created 6 years ago (modified 6 years ago)
          Show previous comments (1)
          M M
          Martin Praxmarer - DevExpress MVP 6 years ago

            yes and no - you should check CellValueChangedEventArgs.ChangedByUser now as the event is still fired…

              Ok, thanks - I read the full story now. So this will/could replace my workaround flag in the controller.
              Greetings from OÖ

              @DX: The above mentioned call of RaiseCellValueChanged with FocusedColumn anyway seems to be buggy.

              M M
              Martin Praxmarer - DevExpress MVP 6 years ago

                np - greets from T ;)

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.