I have a custom control containing a textbox and a button. I use the custom control as an editing control for a specific column in an ObjectListView.
On CellEditStarting event I do:
private void datalistViewProducts_CellEditStarting(object sender, CellEditEventArgs e)
{
var ctl = (MyCustomControl)e.Control;
e.Control = ctl;
}
The ObjectListView's ConfigureControl
method already calls the control's Select
method. It works fine if I have a usercontrol inheriting directly from a standard TextBox.
So I added the following code to my usercontrol:
public new void Select()
{
textBox.Select();
}
However, having a usercontrol as described above, the Select
method does not move the focus to the textbox.
What am I missing here?