Hi Larry,
Why do you want to pass the control name as a parameter?
You can directly access the control inside your event handler.
protected void cmbControl_Open(object sender, EventArgs e)
{
cmbStatus.DisplayMemberPath = "Field";
}
Yup, if you are using the same event handler for multiple ComboBox, then also you can get the combobox very easily. You can notice that, your event handler has a sender. This is your specified combobox that you opened.
So, write the following code in that case:
protected void cmbControl_Open(object sender, EventArgs e)
{
ComboBox myCombo = sender as ComboBox;
myCombo.DisplayMemberPath = "Field";
}
If this answers your query, please "Mark As Answer".
Thank you for posting at CodeProject.