selecteditem

How to determine WPF SelectedItem for a window

Hi, I have a WPF app with many list based controls in a window, which all are bound to different CollectionViews. At the window level is there a way to get the current selected item for the currently in focus list based control? I know I can do this with some fairly trivial code by looking for the in focus element but does WPF support...

(CSS?) Eliminating browser's 'selected' lines around a hyperlinked image?

The attached screenshot is from OS X/Firefox 3. Note that the center tab (an image) has a dotted line around it, apparently because it was the most-recently selected tab. Is there a way I can eliminate this dotted line in CSS or JavaScript? (Hmmm...the free image hosting service has reduced the size of the image. But if you could see it,...

Getting SelectedItem of a DropDownList and retaining list items

Ok Here's the issue.. I have small page which has label, dropdownlist and a submit button. <div> <asp:label id="Message" runat="server"/> <br /> Which city do you wish to look at on hotels for?<br /><br /> <asp:dropdownlist id="Dropdownlist1" runat="server" EnableViewState="true"> </asp:dropdownlist...

Shell extension for selected file

Is there a way to know which file is being selected in windows explorer? I've been looking at the tutorial posted here Idiots guide to ... but the actions described are: hover context menu properties drag drag and drop I wonder if is there a method that get invoked when a file is selected. For instance to create a thumbnail view ...

What is the best way to implement a 2D grid of radio buttons?

What is the best way to implement a 2D grid of radio buttons so that only one option in each column and one option in each row can be selected? ...

WPF Xaml Custom Styling Selected Item Style in a ListBox

I have a list box that scrolls images horizontally. I have the following XAML I used blend to create it. It originally had a x:Key on the Style TaregetType line, MSDN said to remove it, as I was getting errors on that. Now I'm getting this error: Error 3 Operation is not valid while ItemsSource is in use. Access and modify elements w...

Why does this simple databinding scenario not work? (ComboBox related)

Hi all, I've been scratching my head on this one for a while now and am stumped at the moment. The problem scenario is easier to explain as code so hopefully it speaks for itself. First of all, I have a silverlight application with the following in the XAML... <UserControl x:Class="SilverlightApplication2.Page" xmlns="http://schemas.m...

object not set to instance of an object!! ComboBox SelectedIndex SelectedItem

I am developing a program which gets all Clearcase regions (basically strings) & adds them to Combo box. I compare an existing clearcase region string in newly added items in combo box & if it is found then I want to select it, but because nothing is selected for the first time, selectedItem is null & selectedIndex = -1. when I assign 0...

WPF: Listbox, centering selected item

Is it possible to always keep selected item in the middle of a listbox? If the user selects an item, I want to scroll so that the newly selected item is in the middle. I guess it want be possible for the 'edge cases' (the first and last few items), but that's ok. ...

[WPF] ComboBox Style problems with DisplayMemberPath

I have a ComboBox and I have set the combo.ItemsSource property to a List object. The Book class contains two properties: "Abbreviation" and "Name". I have set the ComboBox's DisplayMemberPath to "Abbreviation" but the following style that is set on the ComboBox does not display the Abbreviation property, but instead shows "Words.Book" ...

Select DataList Item to Display in ListBox or Another DataList

Hello, all - first posting. I'm not sure if I am approaching this the right way or if it's even possible. I'm using Visual Web Developer 2008, VB. What I want to do is select a DataList item and have it display on a different part of the page, maybe in a ListBox or another DataList - whatever can display the selected data. That selected...

Silverlight2 Howto set SelectedItem in Combobox

Hi, in my first Silverlight 2 app I've a datagrid which is bound to a ObservableCollection, in one of the colums I've put a Combobox which hold a ObserversableCollection A "Order" consists of number of properties, one of those properties is a "Customer" object. If I show the orders in the grid, I would be happy if the correct customer...

selecteditems and selectedindex c#

Hi I'm new to C# and I'm starting to learn how to program I'm learning to program into the Visual Studio Microsoft Edition where I use the WindowsApplication instead of the Console. While trying to make this code, I encountered this command: Selected Index and Selected Item and I would like to know the difference between the two. I'm qu...

Binding ComboBox.SelectedItem in Silverlight

This one is driving me crazy. Here's the XAML: <UserControl x:Class="SilverlightApplication1.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Grid x:Name="LayoutRoot" Background="White"> <StackPanel HorizontalAlignment="Left" VerticalAl...

Binding ComboBox.SelectedItem in Silverlight (more)

Related to my previous question: http://stackoverflow.com/questions/855519/binding-combobox-selecteditem-in-silverlight I have a ComboBox bound like so: <ComboBox x:Name="PART_CommentaryList" HorizontalAlignment="Left" Margin="3" ItemsSource="{Binding Path=CurrentVideo.Commentaries}" SelectedItem="{Binding Path=Curr...

Why does Path=SelectedItem.Content work for ComboBox in WPF but not Silverlight?

The following code works fine in WPF. In Silverlight it gives me the error **Invalid attribute value {Binding ElementName=WhichNumber, Path=SelectedItem.Content} for property Text. ** How can I get this to work in Silverlight? <ComboBox x:Name="WhichNumber" Width="100" HorizontalAlignment="Left" Margin="10" SelectedIndex="0"> ...

What is the easiest way to handle SelectedItem event with MVVM?

In the code below, when user selects Customer in the combobox, the customer's name is displayed in a textbox. I fill the Combox box with an ObservableCollection property on my ViewModel but how do I handle the SelectedItem event in my ViewModel? It's easy to implement this with code-behind as shown below, but how do I do this with the ...

WPF TreeView - Force SelectedEvent on Item that is already selected

Hello All, Summarized Question: In the WPF TreeView, how can I force the selected event on an item that is currently the selected item? Detailed Info: I am trying to add functionality to my WPF TreeView by adding multiselect using shift(for a range) and control(for toggling selection of an item). I've implemented my own SelectedItems c...

WPF: Problems using Data Templates with content controls

Hi, I hope someone out there can help me. I have created a dropdown treeview using a treeview in a popup and displaying the selected item in a content control. <Grid Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" > <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width=...

WPF ListView Programmatically Select Item

Oh, man. I'm feeling the WPF pain this week. So for my next trick, I'm now unable to figure out how to select an item programmatically in a ListView. I'm attempting to use the listview's ItemContainerGenerator, but it just doesn't seem to work. For example, obj is null after the following operation: //VariableList is derived from Bi...