Hi there,
I have a RadGrid which I have created a custom EditFormSettings. The item I am making available for edit has child records which I display inside the edit FormTemplate as a Listbox. This listbox displays the current children for the item being edited as well as a listbox of options which the user can select one item which I want to add to the first listbox of current children.
What I am trying to do is use a server-side button inside the template to get the selected item from one listbox and add it to the other listbox of the items children.
So once the user clicks the button how do I get access to the listbox on postback?
Here is an example of my EditForm Template code.
I have a RadGrid which I have created a custom EditFormSettings. The item I am making available for edit has child records which I display inside the edit FormTemplate as a Listbox. This listbox displays the current children for the item being edited as well as a listbox of options which the user can select one item which I want to add to the first listbox of current children.
What I am trying to do is use a server-side button inside the template to get the selected item from one listbox and add it to the other listbox of the items children.
So once the user clicks the button how do I get access to the listbox on postback?
Here is an example of my EditForm Template code.
<EditFormSettings EditFormType="Template"> |
<FormTemplate> |
<table width='100%'> |
<colgroup><col width='10' /><col width='420' /><col width='200' /><col width=* /></colgroup> |
<tr> |
<td></td> |
<td> |
<table width='100%' border='0'> |
<colgroup><col width='30' /><col width='200' /></colgroup> |
<tr> |
<td>Name</td> |
<td> |
<radI:RadTextBox ID="rtbAECName" runat="server" Text='<%# Bind( "AECName") %>' Width='190px'> |
</radI:RadTextBox></td> |
</tr> |
<tr> |
<td>Email</td> |
<td> |
<radI:RadTextBox ID="rtbEmail" runat="server" Text='<%# Bind( "Email") %>' Width='190px'> |
</radI:RadTextBox></td> |
</tr> |
<tr align=right> |
<td colspan="2"> |
</td> |
</tr> |
</table> |
</td> |
<td> |
<table><tr><td><asp:ListBox ID="lbAllCountries" runat="server" DataSourceID="odsCountries" |
DataTextField="Country" DataValueField="ID" Rows="12" Width="220px"></asp:ListBox></td><td> |
<asp:Button ID="btnAdd" runat="server" Text="-->" OnClick="btnAdd_Click" /><br /> |
<asp:Button ID="btnRemove" runat="server" Text="<--" /></td><td> |
<asp:ListBox ID="lbAssignedCountries" runat="server" Rows="12" Width="220px"></asp:ListBox></td></tr></table> |
</td> |
<td></td></tr> |
<tr> |
<td> |
</td> |
<td align="center" colspan="2"> |
<asp:Button ID="btnUpdate" runat="server" Text="Update" CommandName="Update" /><asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" /></td> |
<td> |
</td> |
</tr> |
</table> |
</FormTemplate> |
<EditColumn UniqueName="EditCommandColumn1"> |
</EditColumn> |
</EditFormSettings> |