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
195
WinGrid, how to keep focus on the add-row after a row been added?
posted

Have an issue where the user want to add several rows in a sequence, without loosing focus on the built in add-row feature.

(Add a row --> Return focus to the first cell in the build in add row, add another row, and so on....)

Tried the following code, after a row has been added...

ultraGrid.ActiveCell = ultraGrid.Rows.TemplateAddRow.Cells[0];

ultraGrid.PerformAction(UltraGridAction.EnterEditMode);

... the built in add-row get focused, BUT before I receive the built in Data Error "Unable to update the row: Column (the first column) does not allow nulls".

(Have a datatable as datasource)

Any idea of how to focus the built in Add-row, or is there a way to get rid of the bult in validation temporarily?

M Segerby

 

 

 

 

 

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    The error message seems to indicate that you are trying to commit an row to the grid with some null values in it's cells and the data source does not allow that. When you click into the template add row and start to edit the row changes from a template add row to a regular add row. If you try to leave that row, the row must be committed to the data source at that time. If the data in the row is not valid (like when there's a null in a field that does not allow nulls), then the row cannot be committed. It sounds to me like you want to have multiple template add rows visible at the same time, but there is currently no support for that in the grid. 

     

Reply Children