The control is embedded, but it does not seem to automatically fire off the
itemcommand for the datagrid. I put a simple Response.Write in the
itemcommand function for the datagrid and it did not work.
My datagrid is simple and only has 4 columns (one of which is the key field
and is invisible) I included the html for the datagrid at the end of this
message, but without formatiing is really hard to read here in the newsgroup
if that helps.
The name of my check box in the templated column is checkbox1 how do I use
the sender argument to tell if it has been clicked?
Thanks,
REB
<asp:textbox id="txtViolationType" runat="server"
Width="236px"></asp:textbox><asp:button id="btnSaveViolation" runat="server"
Text="Save Violation"
CausesValidation="False"></asp:button></FONT></STRONG><STRONG><FONT
size="2"><asp:datagrid id=dgTrafficViolations runat="server"
BorderStyle="None" BackColor="White" AutoGenerateColumns="False"
DataMember="Table" DataKeyField="DriverViolationID" DataSource="<%#
dsViolations1 %>" BorderColor="#CC9966" BorderWidth="1px" CellPadding="4">
<SelectedItemStyle Font-Bold="True" ForeColor="#663399"
BackColor="#FFCC66"></SelectedItemStyle>
<ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="#FFFFCC"
BackColor="#990000"></HeaderStyle>
<FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
<Columns>
<asp:BoundColumn Visible="False" DataField="DriverViolationID"
SortExpression="DriverViolationID"
HeaderText="DriverViolationID">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="Violations Notice">
<ItemTemplate>
<asp:CheckBox id=CheckBox1 runat="server" AutoPostBack="True"
Checked='<%# DataBinder.Eval(Container, "DataItem.DriverTraffic Violations
Notice") %>'>
</asp:CheckBox>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=TextBox1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.DriverTraffic Violations Notice") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="DriverTrafficViolationsNoticeDate"
SortExpression="DriverTrafficViolationsNoticeDate"
HeaderText="Notice Date"
DataFormatString="{0:d}"></asp:BoundColumn>
<asp:BoundColumn DataField="DriverViolationType"
SortExpression="DriverViolationType"
HeaderText="Violation"></asp:BoundColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="#330099"
BackColor="#FFFFCC"></PagerStyle>
</asp:datagrid>