I have a DropDownList whose SelectedIndexChanged event I set:
move.SelectedIndexChanged += Move;
public void Move(object sender, EventArgs e)
{
}
I'd like to create a class derived from EventArgs which is the argument "e" that gets passed to the Move method.
public void Move(object sender, EventArgs e)
{
MyEventArgs my_e = (MyEventArgs)e;
int Id = my_e.ID;
position = my_e.position;
etc;
}
Is that possible? If it were, I could give this class properties that I could use in the event:
I need to do this as I'd like to pass more information to the Move method than a DropDownList currently contains. I can put this information in the ID of the DropDownList but that is ugly and requires messy string parsing.
eg
ID = "Id_4_position_2"
Note: As requested by Developer Art
I am moving elements in a list. I need to know the old order and the new order. I can do that by using the DropDownList ID to store the old order and SelectedValue to store the new order. So actually, I have all I need but it seems inelegant to put an order in an ID. I also want to avoid custom events, seems too much work.