A
arby
Hi There,
I have a datagrid with the following template column definition:
<asp:TemplateColumn HeaderText="Select">
<ItemTemplate>
<asp:CheckBox Runat="server" ID="chkAdd"
AutoPostBack="True">
</asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
Next, under my design window I double-clicked on my ItemCommand event
and added the following code:
private void gridMediaResults_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string test;
test = "hello world.";
)
.... I also have this as well ...
private void chkSelect_CheckedChanged(object sender, System.EventArgs e)
{
string test = "";
test = "ok?";
}
I then start up my page and everything looks good, I have a datagrid
with my checkboxes. However, whenever I click on the checkboxes the
code does not get into the event handler - I know this by putting a
breakpoint in the debugger and I never gain control. Just to test I
tried other methods, like populating a textbox from this event and
nothing would work.
From reading posts, this seems to be the best method for handling
dynamically created checkbox events. Is there something I'm doing
wrong or maybe a better method?
Thanks
Jason
I have a datagrid with the following template column definition:
<asp:TemplateColumn HeaderText="Select">
<ItemTemplate>
<asp:CheckBox Runat="server" ID="chkAdd"
AutoPostBack="True">
</asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
Next, under my design window I double-clicked on my ItemCommand event
and added the following code:
private void gridMediaResults_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string test;
test = "hello world.";
)
.... I also have this as well ...
private void chkSelect_CheckedChanged(object sender, System.EventArgs e)
{
string test = "";
test = "ok?";
}
I then start up my page and everything looks good, I have a datagrid
with my checkboxes. However, whenever I click on the checkboxes the
code does not get into the event handler - I know this by putting a
breakpoint in the debugger and I never gain control. Just to test I
tried other methods, like populating a textbox from this event and
nothing would work.
From reading posts, this seems to be the best method for handling
dynamically created checkbox events. Is there something I'm doing
wrong or maybe a better method?
Thanks
Jason