Hi,
I have created a custom GridColumnEditor that extends GridTextColumnEditor. My custom editor holds a composite control (consisting of a textbox and some other controls) that is used for editing the value. The composite controls shows up with the correct value when I press the edit button, but I have problems extracting the new value when I press the save button, I always get the old value.
I use the following for extracting the new value: (EditItem.Value (which is the textbox value) always has the old value)
List<UIPhaseItem> items = new List<UIPhaseItem>();
foreach
(GridColumn column
in
e.Item.OwnerTableView.RenderColumns)
{
if
(column
is
IGridEditableColumn)
{
IGridEditableColumn editableCol = (column
as
IGridEditableColumn);
if
(editableCol.IsEditable)
{
IGridColumnEditor editor = editManager.GetColumnEditor(editableCol);
if
(editor
is
CustomColumnEditor)
{
items.Add(((CustomColumnEditor)editor).EditItem);
}
}
}
}
Any ideas?
Below is my custom column editor.
public
class
CustomColumnEditor : GridTextBoxColumnEditor
{
Public UIPhaseItem EditItem {
get
;
set
;}
public
CustomColumnEditor(UIPhaseItem item,
long
id)
{
this
.EditItem = item;
this
.EditItem.Enabled =
true
;
this
.EditItem.Visible =
true
;
this
.EditItem.ID = id.ToString();
}
protected
override
void
AddControlsToContainer()
{
this
.ContainerControl.Controls.Add(EditItem);
}
protected
override
void
LoadControlsFromContainer()
{
this
.EditItem = (UIPhaseItem)
this
.ContainerControl.Controls[0];
}
}