Hello,
I am using Netadvantage 2010.1, and I am facing problem with the UltraGrid.
If i modify anything in the Template Add Row and I click back to an another row, a new row well be add in my ultragrid
this is the normal behavior.
what is ur problem?if you don't want to add new row use
UltraGrid1.DisplayLayout.Override.AllowAddNew = AllowAddNew.No;
thanks for the suggestion Hady :)
My problem, when I modify anything In the first row and I click back to an another well be created!
Hi,
I don't understand what you are asking. If a user edits the TemplateAddRow and leaves the row, then that row is committed to the data source.
That's the whole point of having a TemplateAddRow - to allow the user to add new rows to the grid.
Are you saying that when a user edits a TemplateAddRow and then leaves that row that you want the users changes to be discarded? That doesn't make any sense.
thanks for the suggestion Mike :)
ok, i try to explain my problem:
I create a button to commit the new row in my ultragrid if there is any empty cell: (this.PerformAction(UltraGridAction.CommitRow); But, when the user edits the TemplateAddRow and then she leaves that row if she click in my ultragrid the row is committed in my ultragrid!
I am unable to view the video you posted here. It appears to require some third-party plug-in and neither FireFox nor Internet Explorer can determine which one.
Anyway,if you are using the TemplateAddRow in the grid, then leaving that TemplateAddRow and clicking on another row in the grid will commit that row. There is no way around this, because the BindingManager in DotNot automatically commits the changes whenever the current position changes.
You could try setting the SyncWithCurrencyManager on the grid to false so that clicking on a grid row does not cause a change in position, but I am not confident that this will work.
Please Mike, have any idea to disable committing row if any cells in row are empty..
You could handle BeforeRowDeactivate and check for IsAddRow and check for empty cells and then cancel the event so as to keep the user in the row. But once they leave the row, there is no way to stop that row from being committed.