In the code below you can see an example of an editor with a button on the right. You can use the button to open a dialog or execute a custom action.
In this example I use an OpenFileDialog as an editor:
class PopUpEditor : SourceGrid.Cells.Editors.TextBoxButton
{
public PopUpEditor():base(typeof(string))
{
Control.DialogOpen += new EventHandler(Control_DialogOpen);
}
void Control_DialogOpen(object sender, EventArgs e)
{
//TODO Open a dialog here
OpenFileDialog dg = new OpenFileDialog();
dg.ShowDialog(EditCellContext.Grid);
Control.Value = dg.FileName;
}
}
.....
You can use this editor with this code:
grid1[0, 0] = new SourceGrid.Cells.Cell("");
grid1[0, 0].Editor = new PopUpEditor();
Davide