How do I add the Click hander for celltype=button

I have a made a cell type be a button. How do I add a handler for the click event to a particular button.


_grid.Model[ 0, 0 ].CellType = "Button";
_grid.Model[ 0, 0 ].Description = "ButtonA";
// += button handler for A

_grid.Model[ 1, 0 ].CellType = "Button";
_grid.Model[ 1, 0 ].Description = "ButtonB";
// += button handler for B



2 Replies

KM Karl Meissnersd October 24, 2008 08:38 PM UTC


Also really fustrating is this does not work.
Button b = (Button)_grid.Model[ 0, 0 ].CellModel.ActiveRenderer.CurrentCellUIElement;
b.Click += new RoutedEventHandler( b_Click );

ActiveRenderer is null during load.

The interfaces needs a lot more comments....




AD Administrator Syncfusion Team October 24, 2008 10:06 PM UTC

Currently, you have to create a CellRenderer and subscribe the the click event in the WireUIElement event in the renderer.

Here is a little sample.




WpfGridStub_52460aa2.zip

Loader.
Up arrow icon