Object Snap Grid
I have a third party grid that is anchored to an object. Each column is bound to an object property. Now I get the selected row from the grid and cast to an object like:
var item = myGrid.ActiveRow.ListObject as Bench;
item.RequestedBy = WindowsIdentity.GetCurrent().Name;
_controller.Process(item);
The problem is that as soon as the item.RequestedBy property changes, the Grid displays the user's name in the column. This is because the string is bound to an object. What can I do to avoid showing the username in the column immediately after assigning a value.
0
a source to share
1 answer
Assuming your third party ListObject class implements the ICloneable interface (it should be), one suggestion would be Clone so you don't work with the same link.
var item = myGrid.ActiveRow.ListObject.Clone() as Bench;
item.RequestedBy = WindowsIdentity.GetCurrent().Name;
_controller.Process(item);
If Clone is not available in the ListObject class, you can implement it in your Bench class.
+1
a source to share