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

[Solved] combo box and text box hide and seek

2 Answers 248 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jo
Top achievements
Rank 1
Jo asked on 01 Mar 2010, 01:20 PM
hi
i have the requirement like this when i select a item in drop down list, depends on the selected item another combo box and text field will dispaly...pls let me know asap...

thanks

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Mar 2010, 01:55 PM
Hello Kolluru,

I guess the comboboxes and textbox are placed inside the FormTemplate of radgrid. If so you can access editform and access the second combo in SelectedIndexChanged event of RadComboBox to set the Visible property based on selection.

C#:
 
    protected void RadComboBox1_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
    { 
        RadComboBox combo = (RadComboBox) o; 
        GridEditFormItem editItem = (GridEditFormItem)combo.NamingContainer; 
        RadComboBox type = (RadComboBox)editItem.FindControl("RadComboBox2"); 
        RadTextBox textbox = (RadTextBox)editItem.FindControl("RadTextBox1"); 
        if (combo.SelectedItem.Text == "Item2"
        { 
            textbox.Visible = true
            type.Visible = true
        } 
        else 
        { 
            textbox.Visible = false
            type.Visible = false
        } 
    } 

-Shinu.
0
Jo
Top achievements
Rank 1
answered on 01 Mar 2010, 02:22 PM
hi shinu

thx for quick reply..dont mind pls send me the asp code also...main i am facing problem is in edit mode the "asp labels" are giving me problem... in telerik rad window "labels" are still displaying....when i use the visible = false property... 
Tags
ComboBox
Asked by
Jo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jo
Top achievements
Rank 1
Share this question
or