I'm trying to subclass DataList to accept a new Command from embedded LinkButtons. Here's my abstract class:
public abstract class BaseFieldGroup : DataList
{
public const string InsertCommandName = "Insert";
public event DataListCommandEventHandler InsertCommand
{
add
{
base.Events.AddHandler(EventInsertCommand, value);
}
remove
{
base.Events.RemoveHandler(EventInsertCommand, value);
}
}
private static readonly object EventInsertCommand;
static BaseFieldGroup()
{
EventInsertCommand = new object();
}
protected virtual void OnInsertCommand(DataListCommandEventArgs e)
{
DataListCommandEventHandler handler = (DataListCommandEventHandler)base.Events[EventInsertCommand];
if (handler != null)
{
handler(this, e);
}
}
}
it seems right, but the Event isn't being caught; I'm not sure why. However, I also noticed that LinkButton sends the even up with a RaiseBubble, I don't know if that's an issue or not. Anyone have thoughts?
Oh, this is 2.0