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

Changing display based on return from WebServiceSettings-Method

3 Answers 27 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Max
Top achievements
Rank 1
Max asked on 06 Apr 2016, 04:14 PM

Hello, I am very new to working with Telerik stuff.

I have a ComboBox that is a dropdown that gets populated from a WebServiceSettings-Method call (it querys our database and returns a RadComboBoxData object). I need to highlight some items in the dropdown with a color based on a flag in our database. I was wondering how to do this.

3 Answers, 1 is accepted

Sort by
0
Max
Top achievements
Rank 1
answered on 07 Apr 2016, 03:17 PM

Is there an event that happens after a WebServiceSettings-Method call that I can hook on to?

Because if there is I can think of a way to do this.

0
Max
Top achievements
Rank 1
answered on 07 Apr 2016, 07:46 PM

In case anyone cares I hooked into OnClientItemDataBound and did

<telerik:RadComboBox [other things] OnClientItemDataBound="MarkFlaggedItems">
function MarkFlaggedItems(sender, eventArgs) {
    var item = eventArgs.get_item();
    var flag = item.get_attributes().getAttribute("Flag"); // Flag is a bool in the database
    if (loaded) { // if item has been flagged mark yellow
        item.get_element().style.backgroundColor = "yellow";
    }
}

0
Max
Top achievements
Rank 1
answered on 07 Apr 2016, 07:49 PM
I can't believe there's no edit on these forums. The "loaded" in the if statement is supposed to be "flag".
Tags
ComboBox
Asked by
Max
Top achievements
Rank 1
Answers by
Max
Top achievements
Rank 1
Share this question
or