SetStyle of specific combobox item

Im trying to create a combobox that makes the text of a
specific item a specific color and bold.
I know i could do this with ALL the items in the list through
something like:
view_comboBox.setStyle("color", 0xFFFFFF);
I want to only do it for a specific item in my list. How
would i go about doing this? There has to be some way to do this.
I know since the combobox uses the list class too if i recall
correctly you could do this to change the background color of a
specific item and add a icon to it next to it by doing the
following:
setPropertiesAt(2, {backgroundColor:0xFF0000, icon: "file"});
My only issue is that it only supports those two properties
and not changing the text color. Is there some workaround to make
it so i can change the text color of a specific item either by
using the list class which is inherited by my combobox or through
the combobox class?

Im trying to create a combobox that makes the text of a
specific item a specific color and bold.
I know i could do this with ALL the items in the list through
something like:
view_comboBox.setStyle("color", 0xFFFFFF);
I want to only do it for a specific item in my list. How
would i go about doing this? There has to be some way to do this.
I know since the combobox uses the list class too if i recall
correctly you could do this to change the background color of a
specific item and add a icon to it next to it by doing the
following:
setPropertiesAt(2, {backgroundColor:0xFF0000, icon: "file"});
My only issue is that it only supports those two properties
and not changing the text color. Is there some workaround to make
it so i can change the text color of a specific item either by
using the list class which is inherited by my combobox or through
the combobox class?

Similar Messages

  • Custom itemRenderer in a F3 ComboBox on specific list items after combobox creation

    Hi,
    I'm trying to set a specific list item in a mx combobox to have a custom item renderer, the problem is that I cannot do this via mxml, it needs to be done via actionscript at a later stage, eg: combobox gets created, combobox  gets populated, user does other tasks, combobox needs to set one or more items in the combobox to have icons (via item renderer)..
    I can do this via the onChange event, but it only applies the icon when the combobox is opened and there is a slight delay so you can see the icon being added.
    Thanks in advance for any help
    J

    Hi,
    If I understand correctly, you can create you comboBox with all items at the begining:
    http://blog.flexexamples.com/2007/08/18/displaying-icons-in-a-flex-combobox-control/
    After that, base on user task, you can filter you comboBox:
    http://blog.flexexamples.com/2008/03/12/using-a-combobox-to-filter-items-in-a-datagrid-in- flex/
    In this way you don't see the delay.
    Johnny
    Please rate answers.

  • How to expand a tree at a specific node/item?

    Hi,
    we have a tree and the nodes/items were binded to context with this code
    lo_nd_nvccmp = wd_context->get_child_node( name = wd_this->wdctx_nvccmp ).
    lo_nd_tree = lo_nd_nvccmp->get_child_node( name = wd_this->wdctx_tree ).
    lo_el_tree = lo_nd_tree->bind_structure( new_item = ls_tree set_initial_elements = abap_false ).
    We want that the tree is expanded at a specific node/item?
    The structure has the field is_expanded of type WDY_BOOLEAN. I think that if the field of the right structure is 'X' then the tree should expanded. How can we find the right structure in the context and change this field to 'X'?
    Code is appreciated.
    Thanks, regards
    Susanne

    Oh, apparently if you try that call right after you create
    the Tree, it will throw a null reference exception. That might
    count as a bug in the flex api...
    If you create a Tree, and give it's dataProvider some xml
    data, and then add it to the stage (addChild), and then you call
    expandItem or expandChildrenOf() right after, you will get a null
    object exception. You have to wait... for something. I don't know
    what.
    I even tried calling _tree.invalidateList() before the
    expandItem, but it will still throw the error...
    I wonder what the Tree needs to wait for? Is this a bug for
    Adobe to fix?

  • Provision that MRP is not be considered for specific line item of Sales Ord

    Is their any provision that MRP is not be considered for specific line item of Sales Order in MRP run? (Ex: Planned order is also generated for free/ADC sample quantity entered in Sales order)

    Dear
    Go to Sales and distribution--> Sales --> Sales Documents -->Schedule Lines --> Assign schedule line categories.
    Choose the item category (eg. TAN)  which is coming in the sales order and enter CN - No. Mat. Planning in the the manual schedule line category (MSL Ca) for MRP type PD.
    This will enable you to choose while creating sales order in the Tab procurement column SL Ca.
    Choose CN - No mat.planning for the schedule items which you don;t want MRP.
    Regards
    Soundar

  • How to reverse the AuC Specific Line Item?

    Hi Gurus,
    I am facing one issue while doing the AuC Reverse. Through T.Code -AIST  i had reverse the AuC line item. but i want to reverse the specific line item.E.g. if there are 10 AuC Assets ( No. 1,2,3.....10)for the same date and want to reverse the 4th and 6th AuC asset line item? how can i reverse this?
    Could you please suggest me to overcome this issue?
    Regards,
    Dhananjay R.

    by mistake raise ....

  • Order booking on specific line item

    Can i book a specific line item in a multi line sales order ?

    By the name Order booking suggests, the booking happens at Order level and not at Order Line level.
    regards,

  • How to validate Combobox items without expanding the combobox.

    Hi,
    I want to select the combobox item.
    before selecting an item I want to validate whether the item is present in the combobox list.
    while validating the item at for loop the combobox get expanded. 
    I don't want to expand it.
    if (children[index].Name == entryToSelect)
    isExists =
    true;
    break;
    Please share your thoughts.....

    Hi Rosy D,
    I also try to test it in my side.
    As far as I know we could collect all items with ComboBox.ObjectCollection class:
    http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.objectcollection(v=vs.110).aspx
    http://stackoverflow.com/questions/17709363/check-if-user-input-are-in-the-combobox-items
    But it seems that I'm failed to use this method in coded UI tests, so I’m afraid that it has this limitation for this issue.
    We would use the
    GetChildren method,
    but as far as I know, we would expand this control.
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/6f71fed3-777f-433a-87b0-e4190ff06632/telerik-combobox-returned-as-an-editbox-vs-combobox?forum=vsautotest
    http://stackoverflow.com/questions/18079008/get-all-values-from-a-listbox-using-coded-ui-test-and-select-it
    Best Regards,
    Jack 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to set particular comboBox item selected once frame loaded?

    I have a comboBox with all the items with data and labels
    (set in the parameter of comboBox). However, I can't set the
    particular comboBox item to display when the frame entered, like
    this:
    var listenerObject:Object = new Object();
    listenerObject.load = function(eventObject:Object) {
    _root.cb.selectedIndex=3;
    _root.cb.addEventListener("load", listenerObject);
    What's wrong?

    You cannot use the load event on a frame, because by the time
    the code runs the component has already been loaded. But what you
    can do is set the properties directly in that frame wihtout the
    need of a listener. Simply write this,line instead of all the
    previous code:
    _root.cb.selectedIndex=3;

  • How to target a specific webapp item

    Hi all,
    Can I target a specific webapp item?  Forexample I have a content holder that has three places for news information, but the css is slightly different on the last two items.  So my two thoughts are to eith specifically target webapp items (ie date) in the three css areas or can/should I do this using a backup list for the last 2 items?  I want them to display newest to oldest.  Will using a backup list keep my date sorting the same or will it start it over again?  Is there a way to tell BC to always display the second latest and then thrid latest item (like you can with the latest item)?
    Thanks.

    Hi there.
    Well there is lots of ways you can do this depending on the exact things you want to do.
    You have {tag_itemid} you can use to form unique classes, You got {tag_counter} on list view that you can use to render something like ns-1,ns-2,ns-3 etc to target with your CSS.
    You got :first-child and :last-child in CSS you can use and you also have nth child in css as well.

  • ComboBox Item How to remove repeating items that came from an entity of a .dbf database

    Hi all,
    Can somebody help me? What  I want to happen is create a ComboBox Item from a .dbf database, the PMXMON contains each product's monthly data. Here's a screenshot of the output:
    Is there a way to remove repeating items without changing the database contents?
    I have this code:
    Private Sub frmYearMonth_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim conn As New System.Data.Odbc.OdbcConnection("Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=C:\;Exclusive=No")
    conn.Open()
    Dim strQuery As String = "SELECT * FROM CSHPMXP1"
    Dim adapter As New System.Data.Odbc.OdbcDataAdapter(strQuery, conn)
    Dim ds As New System.Data.DataSet()
    adapter.Fill(ds, "PMXMON")
    With ComboBox1
    .DataSource = ds.Tables("PMXMON")
    .DisplayMember = "PMXMON"
    .ValueMember = "PMXMON"
    .SelectedIndex = 0
    .Text = "--YYYYmm--"
    End With
    End Sub
    Thanks :)
    Geee

    You can use Distinct keyword to return unique records from your DB.
    On the side  I'm not seeing any informative value in your Comobox, if you trying to show product monthly data.
    SELECT Distinct PMXMON
    FROM CSHPMXP1
    Fouad Roumieh

  • Ignore some specific Open item in AR during credit check

    Hi,
    User had a customer whose AR open items are subjected to "settlement issues" and are still opened after 90 days.
    The customer had been assigned a risk category that will blocked the sales order when open item is more than 90 days.
    How can I configured such that the credit check will bypass the selective open item (AR) document line items for a certain customer without changing the same checking for other customer within the same credit control area.
    Currently, whenever a sales order is raised, it would be blocked by the above and the documentation to releasing it can takes over a few days. Not only that, a hugh paperwork are required as stipulated by audit requirement.
    Any options to bypass selectively?
    Thanks

    If Im reading this right you want the open AR item that is in dispute excluded from credit check thus not placing new orders on hold due to the oldest item check
    Create a special G/L indicator that is excluded from credit check. During the AR process this indicator can be applied to either the total invoice or the remaining amount. The system will then exclude the disputed item from credit checks allowing all other sales to proceed as normal without affecting the way the credit check works for all customers. Once the dispute is resolved and if the amount becomes an actual outstanding recievable the indicator can be removed and will once again be included in the scope of credit check for the specific customer.

  • WPF Finding Selected ComboBox Item Within DataGrid

    Hi all... I'm having an issue trying to access the selected item value in a ComboBox within a DataGridTemplateColumn. 
    Through another question/answer I have got the ComboBox displaying the names as it should but the next step I'm having issues with is to be able to loop through each row in the DataGrid and determine the selected value of the ComboBox in that row as
    well as some other items and run some other code based on those values. 
    Any help would be appreciated. 
    Thanks,
    Greg
    <Grid>
    <DataGrid x:Name="gvDefaultCWWSchedule" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10,109,10,214" AutoGenerateColumns="False" Grid.Row="0"
    AllowDrop="True" IsReadOnly="False" SelectionMode="Single" Background="Beige" CanUserAddRows="False">
    <DataGrid.Columns>
    <DataGridTemplateColumn Width="150">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <ComboBox Name="ddlUsers"
    ItemsSource="{Binding Path=Users}"
    DisplayMemberPath="{Binding Name, Mode=TwoWay}"
    SelectedValuePath="{Binding Uid, Mode=TwoWay}"
    SelectedIndex="{Binding Uid, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
    SelectionChanged="ComboBox_SelectionChanged"
    >
    <ComboBox.ItemTemplate>
    <DataTemplate>
    <StackPanel Orientation="Horizontal">
    <TextBlock Text="{Binding Name}" />
    </StackPanel>
    </DataTemplate>
    </ComboBox.ItemTemplate>
    </ComboBox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <DataGridTextColumn Binding="{Binding WeekNumber}" />
    </DataGrid.Columns>
    </DataGrid>
    <Button Content="Button" HorizontalAlignment="Left" Margin="729,32,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
    </Grid>
    public partial class Test : Window
    public Test()
    InitializeComponent();
    BindDefaultCWWSchedule();
    private void BindDefaultCWWSchedule()
    // THIS IS COMING FROM MY DB
    List<CurrentUser> UsersFinal = new List<CurrentUser>();
    UsersFinal.Add(new CurrentUser { Uid = 1, Name = "JOHN" });
    UsersFinal.Add(new CurrentUser { Uid = 2, Name = "BILL" });
    UsersFinal.Add(new CurrentUser { Uid = 3, Name = "MARY" });
    ObservableCollection<CWWDefaultScheduleWeek> DefaultSchedules = new ObservableCollection<CWWDefaultScheduleWeek>();
    DefaultSchedules.Add(new CWWDefaultScheduleWeek { Users = UsersFinal, WeekNumber = 1, SelectedUser = null });
    DefaultSchedules.Add(new CWWDefaultScheduleWeek { Users = UsersFinal, WeekNumber = 2, SelectedUser = null });
    DefaultSchedules.Add(new CWWDefaultScheduleWeek { Users = UsersFinal, WeekNumber = 3, SelectedUser = null });
    DefaultSchedules.Add(new CWWDefaultScheduleWeek { Users = UsersFinal, WeekNumber = 4, SelectedUser = null });
    gvDefaultCWWSchedule.ItemsSource = DefaultSchedules;
    private void Button_Click(object sender, RoutedEventArgs e)
    var rows = gvDefaultCWWSchedule.ItemsSource;
    ObservableCollection<CWWDefaultScheduleWeek> CWWSchedAssignments = new ObservableCollection<CWWDefaultScheduleWeek>();
    foreach (var row in rows)
    CWWDefaultScheduleWeek r = (CWWDefaultScheduleWeek)row;
    // FOR EACH ROW HERE I'M WANTING TO CREATE A LIST OF ITEMS AND RUN FURTHER CODE BASED ON IT... ISSUE IS FINDING THE ACTUAL SELECTED USER ON EACH ROW...
    CWWSchedAssignments.Add(new CWWDefaultScheduleWeek
    Users = r.Users,
    SelectedUser = r.SelectedUser,
    WeekNumber = r.WeekNumber
    private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
    gvDefaultCWWSchedule.CommitEdit();
    public class CWWDefaultScheduleWeek
    public IEnumerable<CurrentUser> Users { get; set; }
    public CurrentUser SelectedUser { get; set; }
    public int WeekNumber { get; set; }
    public class CurrentUser
    public int Uid { get; set; }
    public string Name { get; set; }

    In a way, wpf is similar to web.
    More so than windows forms anyhow.
    XAML is mark up and flows like html.
    You have padding and margin which are rather familiar concepts.
    Whereas windows forms is absolute positioning and... well totally different from markup.
    You might find this sample interesting as a sort of mvvm taster.
    https://gallery.technet.microsoft.com/WPF-Dialler-simulator-d782db17
    and event handling equivalents
    http://social.technet.microsoft.com/wiki/contents/articles/30564.wpf-uneventful-mvvm.aspx
    Note
    With a combo you bind the selecteditem to a propfull and then you can put a method call in the setter.  That will then be invoked when the user changes selection.
    Good luck and welcome to wpf development.
    It's a great technology.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How to create a custom listview with a specific listview item style?

    Hi everybody, I am trying to implement a custom image gallery. It has a very distinct design though, It supports drag and drop reordering. Each item has a button on the left and a thumbnail. The drag and drop should happen only when we drag the thumbnail
    and drop on the + buttons. I tried a lot of ways but none of them seem to work properly. The design of the list view is as the image below. 
    the first item in the list view looks like this. a button and a thumbnail and the last item looks the same but instead of a thumbnail it has an icon. When the add button is clicked a open file dialog appears and we can insert a thumbnail when the add button
    which is on the left and right of the thumbnail is clicked. When the add button at the end is clicked it adds a thumbnail at the end. How do i implement something like this ? Any help is much appreciated. 
    This is the code that i have for the list view item container.
    <Style TargetType="ListViewItem" x:Key="ContainerStyle" >
    <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type ListViewItem}">
    <StackPanel Orientation="Horizontal">
    <Button x:Name="AddButton"
    Style="{StaticResource SeparatorButtonStyle}"
    Tag="{TemplateBinding Tag}" AllowDrop="True"
    HorizontalAlignment="Left"
    Click="AddBtn_Clicked" VerticalAlignment="Center" Margin="10,0,10,0"/>
    <Border x:Name="Bd" BorderBrush="Transparent" BorderThickness="5" Background="{TemplateBinding Background}" Margin="10,10,10,15" SnapsToDevicePixels="true">
    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
    </Border>
    </StackPanel>
    <ControlTemplate.Triggers>
    <Trigger Property="IsSelected" Value="true">
    <Setter Property="Background" TargetName="Bd" Value="#098ae4" />
    </Trigger>
    <Trigger Property="IsEnabled" Value="false">
    <Setter Property="Background" TargetName="Bd" Value="#098ae4" />
    </Trigger>
    </ControlTemplate.Triggers>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    <Setter Property="IsSelected" Value="False" />
    </Style>
    The datatemplate looks like this..
    <DataTemplate DataType="{x:Type local:ThumbData}">
    <Border BorderThickness="3,3,3,3" x:Name="thumbnailborder" PreviewMouseMove="MouseOverImage" MouseLeave="thumbnailborder_MouseLeave_1" AllowDrop="True" Tag="{Binding ThumbNumber}" DataContext="{Binding}" Width="150" PreviewMouseDown="Page_PreviewMouseDown" PreviewStylusDown="Page_PreviewStylusDown">
    <StackPanel x:Name="border" Background="LightGray">
    <Border>
    <Grid>
    <Border x:Name="transpBk" Height="{Binding ActualHeight, ElementName=thumbImage}" Width="{Binding ActualWidth, ElementName=thumbImage}" VerticalAlignment="Center" HorizontalAlignment="Center" />
    <Image x:Name="thumbImage" Source="{Binding ImageSource}" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Uniform" Width="150" Height="100" />
    </Grid>
    </Border>
    <Border Width="150" Height="20" x:Name="ThumbnailNumberPanel">
    <Border Background="{Binding PColor}" Opacity="0.8" Width="150" HorizontalAlignment="Center" Height="20">
    <TextBlock Text="{Binding ThumbNumber}" TextWrapping="NoWrap" TextTrimming="WordEllipsis" VerticalAlignment="Center"
    HorizontalAlignment="Center" FontFamily="Segoe UI" Foreground="White" FontSize="11" TextAlignment="Center"
    Width="150" Margin="0" PreviewMouseDown="Page_PreviewMouseDown" PreviewStylusDown="Page_PreviewStylusDown"/>
    </Border>
    </Border>
    </StackPanel>
    </Border>
    </DataTemplate>
    Thanks and Regards, JohnnyWalker.

    Hello Johnny,
    Can you describe what do you mean by say this:
    "we can insert a thumbnail and dropped on to the add button which is on the left and right of the thumbnail"
    And also could you describe in which part you have problem?
    If you don't know how to add a image to your listviewitem, please try check VisualTreeHelper Class, use it to the specific element you need and then add the element, like a image to it.
    See a code sample about it:http://rachel53461.wordpress.com/2011/10/09/navigating-wpfs-visual-tree/
    And check for details from MSDN:http://msdn.microsoft.com/en-us/library/system.windows.media.visualtreehelper(v=vs.110).aspx
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.
    Hi Barry, Sorry that was a typo. What i meant to say was we can insert a new thumbnail when the + button which are on either side of the thumbnail is clicked.
    There are two problems that i am facing.
    How do i do drag and drop by dropping on to the + buttons? Drag and drop should not work when one thumbnail is dropped on to the other. Multiple thumbnails can be selected and dragged and dropped to reorder. The + buttons should not be dragged nor
    selected.
     Dragging the last "add thumbnail" should not be possible. It has to be there always at the end. And user should not be able to select, reorder or delete it.
    I have a class which holds the thumbnail and i am setting the observable collection as the item source of the list view. i do not have any problem in showing the thumbnails.
    Thanks and Regards, JohnnyWalker.

  • MAP ANLE item to specific line item in FI

    Hello SAP Guru,
    Good day!
    We ahve a requirement to map asset values to particular purchase order. And if the amount settle to the Fixed Asset came from AUC, we can map the original FI document number in table ANLE. Thats right, we can find the original FI document number in the ANLE table field "Original Document Number". Original document number can came from  MIRO which came from PO that is settled to WBS (which is eventually settle to FXA) or came from direct posting to the WBS. Sometimes, there are line item in the FI document that has no PO number. Is there a way to map ANLE table to specific FI line item?
    Thanks!
    Jhero

    Hello Alok,
    You can find info from PO -> QUOT -> BIDINV via SRC_GUID field which has original item GUID. Try following function module.
    1. FM BBP_PD_PO_GETDETAIL
    E_ITEM-SRC_GUID  <- Get QUIT item GUID
    2. BBP_PD_QUOT_ITEM_GETDETAIL
    ES_ITEM-SRC_GUID <- Get BIDINV item GUID
    3. BBP_PD_BID_ITEM_GETDETAIL
    ES_ITEM <- Get BIDINV item information.
    Regards,
    Masa

  • Combobox Items vanishing?

    I have a problem with ComboBox selection. Items above the last selected seem to be vanishing from the list. I'll show my xaml and then explain:
    <ComboBox x:Name="cmbFirmness" HorizontalAlignment="Left" Margin="86,106,0,0" VerticalAlignment="Top" Width="227" SelectionChanged="cmbFirmness_SelectionChanged" Grid.ColumnSpan="2">
    <x:String>Soft</x:String>
    <x:String>Medium</x:String>
    <x:String>Hard</x:String>
    </ComboBox>
    So, for example, if I select 'Medium' from the list, then open the list again, I can only see 'Medium' and 'Hard'.
    If I select 'Hard' then open the list again, I can only see 'Hard'. It's like the other options have vanished, or can't be scrolled to.
    Thanks in advance for any help you can offer.

    Hi L61,
    Well Done!
    I am very glad that you have solved your problem by yourself, if you have any other questions welcome to post it in this forum.
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for