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
30
How to edit multiple rows?
posted

I have following requirements to get done.

Add unbound column for "Edit" button in each row, preferly at the last column.

Once user clicks "Edit" that row is now editable, but only few columns are allowed to be edited.  Also the "edit" button now becomes "Cancel" so that user may cancel that particular row out of edit mode, restoring the original value.

User may choose to edit one or more rows so it keeps multiple rows in edit mode.

Button outside of the grid will trigger the rows in edit mode to be updated.

I look everywhere for training video but couldn't find any that will do "edit" row.  Also I'm clueless of what edit template is.  If you know of any helpful video link, let me know.

TIA.

Fyi, the grid is bound at runtime.  The UltraGrid version is 7.1 and we do have the latest version with license.  We would like to keep the 7.1 in place if possible.

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    There's a lot of stuff here. Which part of this is giving you trouble?

    To add a button column to the grid, you would use the InitializeLayout event. You can add an unbound column to the root band and set it's Style to Button. You would use the InitializeRow event to populate the value of the cells in this column with whatever text you want to be on the button. So you would probably have to examine the row to see if the cells are editable and base the text on that.You use the ClickCellButton event of the grid to handle clicks on this button.

    To enable certain cells, you would use the Activation property on the cell. You will probably also want to use CellActivation on the column to permanently disable certain fields.

    Here's a KB article the describes all the ways you can disable things in the grid.

    HOWTO:How can I make a grid or a column, row, or cell in the UltraWinGrid disabled or read-only?

    A RowEditTemplate is like a form that displays and edits values from a single row in the grid.

Reply Children