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

[Solved] item.Combobox

3 Answers 158 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Michael Tissington
Top achievements
Rank 1
Michael Tissington asked on 10 Dec 2007, 03:36 AM
In the ASP.NET controls I could do something like

if (item.Text == item.ComboBox.get_text())
{
}

How do I do this with the new RadComboBox ? 

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 10 Dec 2007, 07:49 AM
Hi Michael Tissington,

With the new combobox the code below should look like:

item.get_comboBox().get_text();

Also, if you need to obtain the items from any of the event arguments, you should do it like:

function EventHandler(sender, eventArgs)
{
    eventArgs.get_item().get_comboBox().get_text();
}

Hope this helps.

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Michael Tissington
Top achievements
Rank 1
answered on 10 Dec 2007, 04:49 PM
Hello Nick,

This does not seem to work - its says that get_comboBox() is not valid.

function SelectedIndexChanging(item)
{
if (item.get_text() == item.get_comboBox().get_text())
{
return false;
}
}
0
Nikolay
Telerik team
answered on 11 Dec 2007, 09:13 AM
Hello Michael Tissington,

The parameters passed to the event handler have been changed. With RadCombobox Prometheus each event handler accepts two parameters  -sender and event arguments:

function SelectedIndexChanging(sender, eventArgs)
{
  //you can simply use sender to obtain the combobox fired the event
  //to obtain the item, you should
  var item =
eventArgs.get_item();
  if item.get_text() == sender.get_text())
  {
     return false;
  }
}


Kind regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Michael Tissington
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Michael Tissington
Top achievements
Rank 1
Share this question
or