Everyone,
I have a question. I have multiple datagrids within a datagrid and each of the inner datagrids needs to have an Asp Button. I can add the button and it looks good, but I cannot figure out how to wire them all up so that I can get an even fired when it posts back. Some help would be great.
Below is the how the datagrids are built:
<div id="div1" style="OVERFLOW: auto; HEIGHT: 300px">
<asp:datagrid id="dgOrders" Width="100%" Runat="server" ShowHeader="False" CellPadding="0" CellSpacing="0" AutoGenerateColumns="false">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<table cellspacing="0" cellpadding="0" width="100%" border="1" bordercolor="#999966">
<tr>
<td>
<table>
<tr>
<td class="FolderNameHeader" style="WIDTH: 80pc">
<input type="checkbox" onclick="CheckFolder(this)" Runat="server" ID="chkFolderSelect" NAME="chkSelect"></asp:CheckBox> <b>Folder
Name:</b> <%# DataBinder.Eval(Container.DataItem, "OrderName" %>
</td>
<td class="FolderNameHeader" style="TEXT-ALIGN: right">
<asp:button CommandName="btnAddNew_Click" CommandArgument=<%# DataBinder.Eval(Container.DataItem, "FXOrderId" %> id="BtnAddNew" tabIndex="21" runat="server" CausesValidation="False" CssClass="buttonred" Text="Add" Width="60px"></asp:button></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right">
<asp:datagrid id="dgTransactions" runat="server" CssClass="textareagrid" Width="100%" AllowSorting="True" HorizontalAlign="Center" GridLines="Both" AutoGenerateColumns="False" DataKeyField="FXOrderId" DataSource='<%# Container.DataItem.CreateChildView("FXOrderId" %>' BackColor=#CCCC99 OnEditCommand="dgTransactions_EditCommand" BorderColor="999966">
<AlternatingItemStyle VerticalAlign="Top" BackColor="#F1F1E6"></AlternatingItemStyle>
<ItemStyle VerticalAlign="Top" BackColor="White"></ItemStyle>
<HeaderStyle Font-Size="XX-Small" CssClass="headerrow"></HeaderStyle>
<Columns>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="" CancelText="" EditText="Edit"></asp:EditCommandColumn>
<asp:TemplateColumn>
<ItemTemplate>
<input type="checkbox" onclick="UnCheck()" runat="server" id="chkSelect" NAME="chkSelect">
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn Visible="False" DataField="FXTransactionId" ReadOnly="True" HeaderText="Id"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="DateLastUpdated"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="FXTransactionStatusCodeId"></asp:BoundColumn>
<asp:BoundColumn DataField="JurisDesc" ReadOnly="True" HeaderText="UCC Financing Statement Description">
<ItemStyle ForeColor="#CC0033"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="TransactionStatusDesc" HeaderText="Status"></asp:BoundColumn>
</Columns>
</asp:datagrid>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid></div>
Thanks in advance for all the help.
Ken
I have a question. I have multiple datagrids within a datagrid and each of the inner datagrids needs to have an Asp Button. I can add the button and it looks good, but I cannot figure out how to wire them all up so that I can get an even fired when it posts back. Some help would be great.
Below is the how the datagrids are built:
<div id="div1" style="OVERFLOW: auto; HEIGHT: 300px">
<asp:datagrid id="dgOrders" Width="100%" Runat="server" ShowHeader="False" CellPadding="0" CellSpacing="0" AutoGenerateColumns="false">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<table cellspacing="0" cellpadding="0" width="100%" border="1" bordercolor="#999966">
<tr>
<td>
<table>
<tr>
<td class="FolderNameHeader" style="WIDTH: 80pc">
<input type="checkbox" onclick="CheckFolder(this)" Runat="server" ID="chkFolderSelect" NAME="chkSelect"></asp:CheckBox> <b>Folder
Name:</b> <%# DataBinder.Eval(Container.DataItem, "OrderName" %>
</td>
<td class="FolderNameHeader" style="TEXT-ALIGN: right">
<asp:button CommandName="btnAddNew_Click" CommandArgument=<%# DataBinder.Eval(Container.DataItem, "FXOrderId" %> id="BtnAddNew" tabIndex="21" runat="server" CausesValidation="False" CssClass="buttonred" Text="Add" Width="60px"></asp:button></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right">
<asp:datagrid id="dgTransactions" runat="server" CssClass="textareagrid" Width="100%" AllowSorting="True" HorizontalAlign="Center" GridLines="Both" AutoGenerateColumns="False" DataKeyField="FXOrderId" DataSource='<%# Container.DataItem.CreateChildView("FXOrderId" %>' BackColor=#CCCC99 OnEditCommand="dgTransactions_EditCommand" BorderColor="999966">
<AlternatingItemStyle VerticalAlign="Top" BackColor="#F1F1E6"></AlternatingItemStyle>
<ItemStyle VerticalAlign="Top" BackColor="White"></ItemStyle>
<HeaderStyle Font-Size="XX-Small" CssClass="headerrow"></HeaderStyle>
<Columns>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="" CancelText="" EditText="Edit"></asp:EditCommandColumn>
<asp:TemplateColumn>
<ItemTemplate>
<input type="checkbox" onclick="UnCheck()" runat="server" id="chkSelect" NAME="chkSelect">
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn Visible="False" DataField="FXTransactionId" ReadOnly="True" HeaderText="Id"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="DateLastUpdated"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="FXTransactionStatusCodeId"></asp:BoundColumn>
<asp:BoundColumn DataField="JurisDesc" ReadOnly="True" HeaderText="UCC Financing Statement Description">
<ItemStyle ForeColor="#CC0033"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="TransactionStatusDesc" HeaderText="Status"></asp:BoundColumn>
</Columns>
</asp:datagrid>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid></div>
Thanks in advance for all the help.
Ken