We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How do I add the Click hander for celltype=button

Thread ID:

Created:

Updated:

Platform:

Replies:

77319 Oct 24,2008 04:01 PM Oct 24,2008 06:06 PM WPF 2
loading
Tags: GridControl
Karl Meissnersd
Asked On October 24, 2008 04:01 PM

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



Karl Meissnersd
Replied On October 24, 2008 04:38 PM


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....



Administrator [Syncfusion]
Replied On October 24, 2008 06:06 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;