在下拉列表中选择索引,找到telerik控件RadNumericTextBox [英] On dropdown selectedindexchange finding telerik control RadNumericTextBox
本文介绍了在下拉列表中选择索引,找到telerik控件RadNumericTextBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
on dropdownselected change我试图找到radnumeric文本框的控件并使其可见= true ..
这是我的.ascx
< asp:标签 ID = lblUnitOfMeasure runat = 服务器 文字 =' <% #Eval( UnitOfMeasure)%> ' 可见 = false > < / asp:标签 >
< asp:DropDownList ID = ddlUnitOfMeasure runat = server 宽度 = 130px OnSelectedIndexChanged = < span class =code-keyword> ddlUnitOfMeasure_SelectedIndexChanged AutoPostBack = true >
< / asp:DropDownList >
< asp:Label ID = lblUnitOfMeasureValue runat = server 文字 =' < ;% #Eval( CallsOver)%> < / asp:Label>
< telerik:RadNumericTextBox ID =txtUnitOfMeasureWidth =40pxrunat =serverVisible =false>< / telerik:RadNumericTextBox>
protected void ddlUnitOfMeasure_SelectedIndexChanged(object sender,EventArgs e)
{
foreach(rdgPanelDataPlane.EditItems中的GridDataItem项)
{
GridEditableItem itemToEdit =(GridEditableItem) )item.EditFormItem;
DropDownList txtUnitOfMeasure =(DropDownList)itemToEdit.FindControl(ddlUnitOfMeasure);
string s = txtUnitOfMeasure.Text;
ViewState [Changed] = txtUnitOfMeasure.Text;
// txtUnitOfMeasure.Visible = true;
}
}
我试过这样但是testbox不可见。
DropDownList dropdownlist1 =(DropDownList)sender;
GridEditFormInsertItem item1 =(GridEditFormInsertItem)dropdownlist1.NamingContainer;
RadNumericTextBox textbox1 =(RadNumericTextBox)item1.FindControl(txtUnitOfMeasure);
if(dropdownlist1.SelectedItem.Text ==Per Call Over)
{
textbox1.Visible = true;
}
请帮我解决这个问题
解决方案
on dropdownselected change i tried to findcontrol of radnumeric textbox and make it visible=true..
Here is my .ascx
<asp:Label ID="lblUnitOfMeasure" runat="server" Text='<%# Eval("UnitOfMeasure") %>' Visible="false"></asp:Label>
<asp:DropDownList ID="ddlUnitOfMeasure" runat="server" Width="130px" OnSelectedIndexChanged="ddlUnitOfMeasure_SelectedIndexChanged" AutoPostBack="true">
</asp:DropDownList>
<asp:Label ID="lblUnitOfMeasureValue" runat="server" Text='<%# Eval("CallsOver") %></asp:Label>
<telerik:RadNumericTextBox ID="txtUnitOfMeasure" Width="40px" runat="server" Visible="false"></telerik:RadNumericTextBox>
protected void ddlUnitOfMeasure_SelectedIndexChanged(object sender, EventArgs e)
{
foreach (GridDataItem item in rdgPanelDataPlane.EditItems)
{
GridEditableItem itemToEdit = (GridEditableItem)item.EditFormItem;
DropDownList txtUnitOfMeasure = (DropDownList)itemToEdit.FindControl("ddlUnitOfMeasure");
string s = txtUnitOfMeasure.Text;
ViewState["Changed"] = txtUnitOfMeasure.Text;
// txtUnitOfMeasure.Visible = true;
}
}
i tried like this but testbox is not visible.
DropDownList dropdownlist1 = (DropDownList)sender;
GridEditFormInsertItem item1 = (GridEditFormInsertItem)dropdownlist1.NamingContainer;
RadNumericTextBox textbox1 = (RadNumericTextBox)item1.FindControl("txtUnitOfMeasure");
if (dropdownlist1.SelectedItem.Text == "Per Call Over")
{
textbox1.Visible = true;
}
Please help me through this
解决方案
这篇关于在下拉列表中选择索引,找到telerik控件RadNumericTextBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文