Last post Jan 12, 2008 07:46 AM by joteke
Jan 04, 2008 12:17 PM|kj2w|LINK
Now you'll have to excuse me for not knowing that much but I am having an issue with trying to hanlde an event from within an ?ITemplate? Below we see the class MyTemplate, which gets called everytime my grid object creates a new row.
public class MyTemplate : ITemplate
public CheckBox chxControl;
public _Default oPage;
//oPage = oPage2;
protected override void OnInit(EventArgs e)
public void InstantiateIn(System.Web.UI.Control container)
chxControl = new CheckBox();
chxControl.ID = "CheckBox1";
chxControl.AutoPostBack = true;
chxControl.CheckedChanged += new EventHandler(ToggleRowSelection);
//chxControl.DataBin += new EventHandler(ToggleRowSelection);
public void ToggleRowSelection(object sender, EventArgs e)
CheckBox chkBx = (CheckBox)sender;
//GridDataItem dataItem = (GridDataItem)chkBx.NamingContainer;
//string strText = dataItem["opnr"].Text.ToString();
//((sender as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked;
What I am having trouble with is that the event ToggleRowSelection gets fired when the Event Handler is handling DataBinding but never gets fired when i swicth the Event to CheckChanged.
I just dont know why?? Any ideas?
Jan 07, 2008 09:07 AM|kj2w|LINK
Anyone have an idea as to why my event isnt getting handled after the page gets written back to the client?
Jan 12, 2008 07:46 AM|joteke|LINK
How does the grid build itself, do you happen to databind it on every request? That can kill postback event routing, too. Post some code.