selecteditem

Set background color for selected items in a ListBox

戏子无情 提交于 2019-11-27 04:05:44
问题 I cannot set the background color for the selected item on a list box. I don't want the alternating colors in this example. I put them in as a test and they work. Trigger IsSelected is firing as the fontweight goes to bold and the foreground goes to red. Setting highlight color brush to SteelBlue does not achieve the desired effect as it goes away when the ListBox loses focus. Red and bold does hold when the ListBox loses focus and is what I want. I want the background color to take and hold

highlighting the selected item in the listview in android

时光怂恿深爱的人放手 提交于 2019-11-27 03:49:15
I am having 1 list view contactslist . I wrote the code for highlighting the selected item in the ListView . It is working. When I click on 1 item it is highlighting that item but the problem is if I click on other item it is highlighting that too. I want to highlight the selected item only. The previous selection will have to gone when I click on another item. arg1.setBackgroundResource(R.drawable.highlighter); This is the code in the click listener using to highlight the selected item. plz help me. Update I'm setting the background of the rows in the adapter: public int[] colors = new int[]

Get Selected TreeViewItem Using MVVM

放肆的年华 提交于 2019-11-27 01:09:12
问题 So someone suggested using a WPF TreeView , and I thought: "Yeah, that seems like the right approach." Now, hours and hours later, I simply can't believe how difficult it has been to use this control. Through a bunch of research, I was able to get the TreeView` control working, but I simply cannot find the "proper" way to get the selected item to the view model. I do not need to set the selected item from code; I just need my view model to know which item the user selected. So far, I have

android listview get selected item

安稳与你 提交于 2019-11-27 00:56:15
I am new to android, I have a code in which I have placed buttons in list view. My list is as.. Number | Name | ID (visibility = gone) | Level | button1 | button2 Function is different in button 1 and button 2 case. I have applied listeners on buttons but when I try to get the ID from list it always shows me the last id. How to know which button was clicked, name and id of related field. I have placed buttons and listener on buttons in getView(...) function. Adesara final ListView lv = (ListView) findViewById(R.id.ListView01); lv.setOnItemClickListener(new OnItemClickListener() { public void

WPF TreeView: How to style selected items with rounded corners like in Explorer

夙愿已清 提交于 2019-11-26 23:47:27
The selected item in a WPF TreeView has a dark blue background with "sharp" corners. That looks a bit dated today: I would like to change the background to look like in Explorer of Windows 7 (with/without focus): What I tried so far does not remove the original dark blue background but paints a rounded border on top of it so that you see the dark blue color at the edges and at the left side - ugly. Interestingly, when my version does not have the focus, it looks pretty OK: I would like to refrain from redefining the control template as shown here or here . I want to set the minimum required

Selecting a Textbox Item in a Listbox does not change the selected item of the listbox

拈花ヽ惹草 提交于 2019-11-26 22:03:49
I Have a wpf Listbox that display's a list of textboxes. When I click on the Textbox the Listbox selection does not change. I have to click next to the TextBox to select the listbox item. Is there some property I need to set for the Textbox to forward the click event to the Listbox? We use the following style to set a PreviewGotKeyboardFocus which handles all events of TextBox control and ComboBoxes and such: <ListView.ItemContainerStyle> <Style TargetType="ListViewItem"> <EventSetter Event="PreviewGotKeyboardFocus" Handler="SelectCurrentItem"/> </Style> </ListView.ItemContainerStyle> And then

WPF Listview Access to SelectedItem and subitems

瘦欲@ 提交于 2019-11-26 22:01:01
问题 Ok, I am having more problems with my C# WPF ListView control. Here it is in all its glory: <Window x:Class="ebook.SearchResults" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="ISBNListView" Height="503" Width="1004"> <Grid> <ListView Name="listView1" Margin"22,30,33,28" MouseDoubleClick="getSelectedItem" > <ListView.View> <GridView> <GridView.Columns> <GridViewColumn Header="ISBN" Width="150" DisplayMemberBinding

ListBox Selected Item Background

£可爱£侵袭症+ 提交于 2019-11-26 21:58:11
问题 I'm trying to change the background of the selected item in a WPF ListBox. I have attempted to implement a style for it, but for some reason it's not being applied. I still get a blue background. Can anyone see why? <UserControl x:Class="Thumbnails" xmlns:local="clr-namespace:ContentPresenter" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d=

How to databind SelectedItem of RibbonComboBox

随声附和 提交于 2019-11-26 21:49:15
问题 My question is basically this one. I thought it would help to provide some more information and code that makes it easier to reproduce the problem, though. Working with the Microsoft.Windows.Controls.Ribbon.RibbonComboBox from the RibbonControlsLibrary feels like walking through a big bog full of bugs, not something you do if you know a way around it. Anywho. The biggest problem I encountered was databinding my SelectedItem. The following is what I started with (after I found out about

WPF - Combobox SelectedItem not getting set?

狂风中的少年 提交于 2019-11-26 21:48:16
问题 I have a ComboBox that has its ItemsSource bound to a static List<CustomSettings> of options. The ComboBox is part of a form which is bound to a CustomObject class, and one of the properties on that class is a CustomSettingProperty. I would like to bind the SelectedItem of the ComboBox to the property specified in the CustomObject, however SelectedItem="{Binding Path=CustomSettingProperty}" is not setting the default selected item. Using breakpoints I can see that it is calling the get;