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.
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.
Thank you for replying.
I made some progress within last few days and I believe you indicated what I have done so far. First using InitializeLayout, I added unbound column. On MouseUp event, I check for Column.Key to see if it is the unbound column. If so, I alternate the cell value from "Edit" to "Cancel". At the same time, I also set desire columns to be CellClickAction.Edit or RowSelect. So far so good. Now I'm stuck in where I need to put databound dropdownlist in the cell while in Edit mode. I also need to display Calendar control in one of the column to be used as datatime value. Can you help?
Thanks.