Ticket T1284194
Visible to All Users

DataGrid Always edit mode | Alternative Get focuced or active column

created 4 days ago

Hi,

Our client requested to edit values in the grid without pressing enter to activate the editor, this can be achieved in many (workaround ways)

  • First question: Is there some setting I can set to achieve this (without implementing workarounds). For instance the "showEditorAlways" which is available in React. (see "DataGrid - Always be in batch edit mode without cell click or double click" https://supportcenter.devexpress.com/ticket/details/t1008729)

  • Second question: Alternatively I can make some kind of workaround using the sample from https://supportcenter.devexpress.com/ticket/details/t1265190 which handles the keydown event and uses await grid.StartEditDataItemAsync(focusedItem, "FieldName"); to activate the editor. To make this work in need to access the active or focused column. Is this possible / availabe?

Thanks

Juri

Answers approved by DevExpress Support

created 3 days ago

Hi Juri,

Thank you for reaching out to us. DxGrid doesn't have an API to initiate editing upon typing, but I added your request to our backlog. We will consider it for future development. Unfortunately, there isn't a straightforward workaround for this usage scenario.

Second question: Alternatively I can make some kind of workaround using the sample from https://supportcenter.devexpress.com/ticket/details/t1265190 which handles the keydown event and uses await grid.StartEditDataItemAsync(focusedItem, "FieldName"); to activate the editor.

The issue with this workaround is that StartEditDataItemAsync is executed asynchronously and the Grid renders editors with some delay. Users might expect that all their input will be immediately displayed in the editor. It is indeed a complex task to synchronize user input with the editor value in this usage scenario, especially if users type and navigate between cells quickly.

Regarding your question about obtaining an active cell, DxGrid does not have an API for this feature, but it is possible. You can assign the column index and row index data attributes to data cell elements in the CustomizeElement event and retrieve this information when needed. For instance, you can implement the GetFocusedCell function and call the corresponding JavaScript function. In the JS function, you can obtain these data attributes:

JavaScript
function GetFocusedCell(){ return document.activeElement.getAttribute('data-column-index') }

I understand that this feature may be helpful, so I added this request to our backlog as well.

We will notify you if our plans change and we begin implementing one of these two features.

Regards,
Alex

    Comments (3)
    Alexander (DevExpress Support) 3 days ago

      Just a follow-up.

      In v25.1, we intend to introduce a mode similar to editOnKeyPress in DevExtreme. Will such a mode align with your requirements?

      SI SI
      Spatial Insight 3 days ago

        Hi Alexander

        Yes, it most likely will be tackle the requirement.

        Will this feature also be available for the DxGrid in Blazor? That would be very welcome."

        Alexander (DevExpress Support) 3 days ago

          Yes, we plan to introduce a mode similar to editOnKeyPress for Blazor DxGrid in v25.1.

          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.