This is a migrated thread and some comments may be shown as answers.

Get button click event in itemTemplate in radToolBar

1 Answer 68 Views
This is a migrated thread and some comments may be shown as answers.
Shannnon
Top achievements
Rank 1
Shannnon asked on 05 Apr 2011, 01:44 AM
I have two button in RadComboBox in RadToolBarButton ItemTemplate:
<telerik:RadToolBarButton Font-Size="X-Small" CausesValidation="false" Value="column">
                         <ItemTemplate>
                         <table>
                         <tr>
                           <td align="right" valign="top">
                 <telerik:RadComboBox ID="RadComboBoxAddColumns" Height="20px" runat="server" EmptyMessage="Add Columns" HighlightTemplatedItems="True" AllowCustomText="True" Width="150px" 
                                Skin="Windows7"
                            <ItemTemplate>
                                <div>
                                    <asp:CheckBox runat="server" ID="chk1" Checked="false" Font-Size="X-Small"/><%# Eval("COLUMN_NAME") %>
                                </div>      
                            </ItemTemplate>
                            <FooterTemplate>
                            <div
                                <asp:Button ID="btnAdd" runat="server" Text="Add" CssClass="button" OnClick="btnAdd_Click"/>   <asp:Button ID="btnReset" runat="server" Text="Reset" CssClass="button" 
                                            OnClick="btnReset_Click"/>
                            </div>
                            </FooterTemplate>
                  </telerik:RadComboBox>  
            </td>
            </tr></table>
                         </ItemTemplate>
                        </telerik:RadToolBarButton>
And I need to map the code behind click event for each button, I can get reference of the button:
Button btnAdd = (Button)RadToolBar1.FindItemByValue("column").FindControl("RadComboBoxAddColumns").FindControl("btnAdd");
But how do I know which button is clicked? Please help!

Thanks a lot!

1 Answer, 1 is accepted

Sort by
0
Shannnon
Top achievements
Rank 1
answered on 05 Apr 2011, 02:06 AM
I got it work right, the button click can automatically map to the right button.
Asked by
Shannnon
Top achievements
Rank 1
Answers by
Shannnon
Top achievements
Rank 1
Share this question
or