I would like to add a custom method for each row i.e. an open detail form that show details for the grid row the button has been clicked for.
Is there any easy solution for that?
EDIT:
What's wrong with my code to style the button?
Image img = imageList1.Images[5];
repositoryItemButtonEdit1.Buttons.Clear();
repositoryItemButtonEdit1.Buttons.Add(new EditorButton(ButtonPredefines.Left, "View Filter", 16, true, true, true, ImageLocation.Default, img));
repositoryItemButtonEdit1.ButtonPressed += new ButtonPressedEventHandler(repositoryItemButtonEdit1_ButtonPressed);
ANSWER (use Glyph)
Image img = imageList1.Images[5];
repositoryItemButtonEdit1.Buttons.Clear();
repositoryItemButtonEdit1.Buttons.Add(
new EditorButton(
ButtonPredefines.Glyph,
"",
16,
true,
true,
true,
ImageLocation.Default,
img
)
);
repositoryItemButtonEdit1.ButtonPressed += newButtonPressedEventHandler(repositoryItemButtonEdit1_ButtonPressed);
Best Answer
The easiest way to do that is to add a
RepositoryItemButtonEdit
as theColumnEdit
for the column.Make sure you set the
TextEdit
property of the RepositoryItemButtonEdit to hidden, and configure the buttons property so that it has your image button.Then handle the
ButtonPressed Event
of the repository item.A simple event handler might look something like:
c#
vb.net