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
460
edit multiple cells at the same time with same value
posted

Hi 

 I want to have the ability to selected x number of cells then edit the value in the first cell and update the other cells with that value.  

I have seen it done but with the winforms,  Please Help 

/Thomas

Parents
No Data
Reply
  • 1560
    Offline posted

    Hello Thomas, 

    By design, if multiple cells are selected and user clicks on one of them, in order to enter edit mode, selection is cleared. 

    In order to maintain selection, while a cell is in edit mode, you have to manually re-select the cell after edit mode has started. This could be achieved by handling the EditModeStarting event on the XamDataGrid and re-setting the Cell.IsSelected property to the previously selected cells.  This means that you need to keep track of what cells were selected. 

    After the cell value is changed, in the EditModeEnded event handler, the new value could be set and get as value to the other selected cells. Keep in mind that these changes would be visible when the focus of the edited cell is lost. 

    I have attached a sample application that uses this approach. Please test it on your side and let me know if I may be of any further assistance.

    Sincerely,
    Teodosia Hristodorova
    Associate Software Developer
Children