Click here to Skip to main content
15,860,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
XML
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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900