如何使用javascript在radcombobox的itemtemplate中找到控件 [英] How to find the control in itemtemplate of radcombobox with javascript

查看:79
本文介绍了如何使用javascript在radcombobox的itemtemplate中找到控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上在我的radcomboboxe项目模板中我有复选框,linkbutton for link按钮我绑定用户如果我选中特定用户的复选框我应该在combobox中获取用户的名字这里我的问题有多少我通过复选框选择的用户应该显示在combobox.below是我的代码



Actually in my radcomboboxe item template i am having the check box,linkbutton for link button i am binding the users if i check the check box of the particular user i should get the name of the user in combobox here my problem how many users i selected through checkbox it should display in combobox.below is my code

<telerik:RadComboBox ID="rdPhysicianscmb" runat="server" Width="75%"

                                               DataSourceID="sdsAttachedUsers"  Filter="Contains" Font-Size="14pt"

                                               onitemdatabound="rdPhysicianscmb_ItemDataBound" LoadingMessage="Loading..." EmptyMessage="">
                                     <ItemTemplate>
                                           <asp:CheckBox ID="chk" runat="server" />
                                           <asp:LinkButton ID="lblphyname" runat="server"  CommandName="Selected"    ForeColor="#0489B5" Font-Size="11pt"

                                       CommandArgument='<%# Eval("AssignedTo") %>'  onclick="lblphyname_Click" Text='<%# Eval("UserID") %>' Font-Underline="false" Font-Overline="false">
                                        </asp:LinkButton>

                                               </ItemTemplate>
                                    </telerik:RadComboBox>

推荐答案

你可以加上这个



< ; asp:checkbox id =chkrunat =servername =<%checkbox=+ =#container.itemindex =%& gt;=xmlns:asp = #unknown >就像我记得的那样,还有其他的东西。为复选框添加一个onclick事件,并在此函数中获取发件人的名称,它将类似于checkbox0并用标签替换复选框并使用



document.getElementsByName( myInput)[0]



此代码。现在你到达了标签。您可以获得用户ID。
you can add this

<asp:checkbox id="chk" runat="server" name="<% " checkbox"="" +="" #container.itemindex="" %&gt;"="" xmlns:asp="#unknown"> something like that as i remembered and others too. Add an onclick event for checkbox and in this function get the name of sender and it will be something like that checkbox0 and replace checkbox with label and use

document.getElementsByName("myInput")[0]

this code. Now you reached the label. You can get the userid.


这篇关于如何使用javascript在radcombobox的itemtemplate中找到控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆