Question

I am trying to set a value for a radcombobox based on the textchanged event(updatestatus) of one textbox.

Its not changing the value.

  <telerik:RadComboBox ID="ddlStatus" runat="server"  Enabled="false"/>

  protected void updatestatus(object sender, System.EventArgs e)
{
    if (txtname.Text != String.Empty)
    {
        if (ddlStatus.Text.Trim() == "Waiting")
        {
            ddlStatus.Text = "complete";

        }
    }
} 

Can Some one suggest me if I am missing something.?

Was it helpful?

Solution

You can use FindItemByText to set value of Talerik dropdown:

   RadComboBoxItem item = ddlStatus.FindItemByText("complete");
   item.Selected = true;

Complete implementation in your case will be something like this:

protected void updatestatus(object sender, System.EventArgs e)
{
    if (txtname.Text != String.Empty)
    {
        if (ddlStatus.Text.Trim() == "Waiting")
        {
           RadComboBoxItem item = ddlStatus.FindItemByText("complete");
           item.Selected = true;
        }
    }
}   
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top