Do you have any idea how to clone a row? I'm using a grid with a TemplateAddRow and I'd like all the values to be filled in the cells of the TemplateAddRow. This is no problem, but when I manipulate the cells in this row by code, the Cell.Modified property of all the cells in this row is set to false, which causes problems in my further data-processing.
Any hint would be appreciated.
Regards, Florian
Hi Mike!
This sounds logical to me. But the example on your help-sites did exactly what I did...
see: http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v8.1~Infragistics.Win.UltraWinGrid.UltraGridCell~DataChanged.html
I was just wondering, why this behaviour wasn't working on the template-add-row.
Anyway. It works fine now. Thanks for your help. Keep up the great support.
Hi Florian,
My guess is that that DataChanged is intended to indicate that the data was changed by the user and so only applies when the row is active. If you modify the row in code, you know you did so and you don't need a property to tell you so - although I can certainly see how it would be convenient and useful. I suspect this is not something that could be changed, though. Changing this behavior would potentially break existing applications.
Mike Saltzman"]Why does this cause a problem? Is it because the grid doesn't consider the template modified by the user, so the row will not be made into a "real" row unless the user modifies it? If that's the case, you can set AddRowModifiedByUser (on the Rows collection) to true.
But thanks to your help, I was able to solve my problem.
If anyone is interested, here are the necessary steps:
UltraGridRow row = UltraGridUsedByComponent.Rows.TemplateAddRow; row.Activate();
[...] //modify all cells
UltraGridUsedByComponent.Rows.AddRowModifiedByUser = true;
Without calling row.Activate() of the template-add-row, not any of the cells change its DataChanged-property, when changing its value. I don't know, if this cell behaviour is wanted. @Mike: do you have information about this?
I'm not sure I follow your question. You are saying that when you modify the value of the cell, the cell.Modified property is false? That seems odd, but my guess is that Modified means modified by the user.
Why does this cause a problem? Is it because the grid doesn't consider the template modified by the user, so the row will not be made into a "real" row unless the user modifies it? If that's the case, you can set AddRowModifiedByUser (on the Rows collection) to true.