Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
535
templated column with checkbox at run time + add events
posted

Hi

we are using ultrawebgrid 10.3 with c#. We are creating templated columns at run time with controls. In this case, it is checkbox. How can I add an server side event to fire when control is created. code is like this:

 

 

 

 

 

 

 

protected

 

class PlaceCheckTemplateForDynamic : ITemplate

{

 

 

 

public const string  KEY_NAME = DYNAMICCOL_KEY;

 

 

public void InstantiateIn(System.Web.UI.Control container)

{

 

 

CellItem cellitem = ((CellItem )(container));

 

 

CheckBox cb = new CheckBox();

cb.ID =

"chkDynamic";

cb.AutoPostBack =

true;

cb.CheckedChanged += new EventHandler(chkDynamic_CheckedChanged); (not working)

cellitem.Controls.Add(cb);

How can I add the event.

Thanks,

Prathiba