Hi,
Im building my own custom column by inheriting from IBindableTemplate. As suggested, I create the controls in the overridden InstantiateIn method. Now to the problem... I need to know if the controls should be created in "insert mode" or "edit mode". How can I do this?
So... when the grid is in insert mode, I want the "edit" and "delete" buttons to change into "insert" and "cancel". Any suggestions?
// Pether
Im building my own custom column by inheriting from IBindableTemplate. As suggested, I create the controls in the overridden InstantiateIn method. Now to the problem... I need to know if the controls should be created in "insert mode" or "edit mode". How can I do this?
public void InstantiateIn( Control container ) |
{ |
switch( _templateType ) |
{ |
case ListItemType.Header: |
break; |
case ListItemType.Item: |
ImageButton editButton = new ImageButton |
{ |
ImageUrl = Images.EditIcon, |
CommandName = "Edit", |
ToolTip = Dictionary.LocalizedString( Dictionary.Word.Edit ) |
}; |
container.Controls.Add( editButton ); |
ImageButton deleteButton = new ImageButton |
{ |
ImageUrl = Images.DeleteIcon, |
CommandName = "Delete", |
ToolTip = Dictionary.LocalizedString( Dictionary.Word.Delete ) |
}; |
deleteButton.Attributes.Add( "onclick", "javascript:return confirm('" + _confirmText + "');" ); |
container.Controls.Add( deleteButton ); |
break; |
case ListItemType.EditItem: |
ImageButton updateButton = new ImageButton |
{ |
ImageUrl = Images.EditIcon, |
CommandName = "UpdateEdited", |
ToolTip = Dictionary.LocalizedString( Dictionary.Word.Update ) |
}; |
container.Controls.Add( updateButton ); |
ImageButton cancelButton = new ImageButton |
{ |
ImageUrl = Images.EditIcon, |
CommandName = "CancelAll", |
ToolTip = Dictionary.LocalizedString( Dictionary.Word.Cancel ) |
}; |
container.Controls.Add( cancelButton ); |
break; |
case ListItemType.Footer: |
break; |
} |
} |
So... when the grid is in insert mode, I want the "edit" and "delete" buttons to change into "insert" and "cancel". Any suggestions?
// Pether