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

RadComboBox hide items

1 Answer 705 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vitaly
Top achievements
Rank 1
Iron
Iron
Vitaly asked on 08 Aug 2014, 08:30 PM
Good Afternoon,
in my html  I have a RadComboBox:

<telerik:RadComboBox ID="ddlDurationofAssign" runat="server" Width="130px" Font-Size="Small" CssClass="txtinput1" AutoPostBack="true" TabIndex="5" OnSelectedIndexChanged="ddlDurationofAssign_SelectedIndexChanged" OnClientFocus="ClientFocus" OnClientBlur="ClientBlur" >
<Items>
<telerik:RadComboBoxItem Text="SELECT TERM" Value="E" Selected="true" />
<telerik:RadComboBoxItem Text="Fall" Value="F" />
<telerik:RadComboBoxItem Text="Spring" Value="S" />
<telerik:RadComboBoxItem Text="Full Term" Value="W" />
</Items>
</telerik:RadComboBox>

On Page Load I would like to  hide "Full Term" item based on certain criteria. How can I do that?

Thanks so much for your help.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Aug 2014, 02:59 AM
Hi Vitaly,

Please try the below C# code snippet to hide an item based on the condition.

C#:
protected void Page_Load(object sender, EventArgs e)
{
    // your condition code
    {
        RadComboBoxItem item = (RadComboBoxItem)ddlDurationofAssign.FindItemByText("Full Term");
        item.Visible = false;
    }
}

Thanks,
Shinu.
Tags
General Discussions
Asked by
Vitaly
Top achievements
Rank 1
Iron
Iron
Answers by
Shinu
Top achievements
Rank 2
Share this question
or