wpf

WPF ListView Grouping specification for one row

I'm studying the sample from MSDN(http://msdn.microsoft.com/en-us/library/ms771309%28VS.90%29.aspx) which makes all the records expanded in groups. Is that possible that if there is only one record in a group, then the row can not be expanded and also the toggle button and the whole expander head are not visible. ...

WPF - Binding multiple values to a datagrind

UPDATED : Clean subject, and summarize it. Hi, I've a datable filled, where each cell is a class like this class CValue{ public object Value; public Brush Quality; private int m_quality; public override String toString(){ return Value.toString(); } } My datagrid is bind on the datable, and it's wo...

WPF TreeViewItem Header Value After DataBinding

Hi, I have a TreeView whose contents (nested TreeViewItems) are generated from a dataset via databinding, which all seems to work fine. The issue I'm running into is that when I try and manipulate the contents of the TreeViewItem headers in code, the Header property returns the DataRowView that the TreeViewItem was generated from and no...

WPF Binding a ListBox to an enum, displaying the Description Attribute.

Is it possible to use the ObjectDataProvider method to bind a ListBox to an enum, and style it somehow to display the Description attriibute? If so how would one go about doing this...? ...

Winforms Richtextbox not properly rendered in WPF project

Hello, I have a very strange issue in my WPF project. The main window contains several wpf controls and winforms RichTextbox(don't ask me why) within WindowsFormsHost element. Richtextbox contains text. In some cases Richtextbox is not properly rendered when loading window (the right part is white like somebody uses erase tool and clears...

How to get all the UI Element into a stackpanel

Am using the below function to get the topmost parent in my application. private DependencyObject GetTopParent() { DependencyObject dpParent = this.Parent; do { dpParent = LogicalTreeHelper.GetParent(dpParent); } while (dpParent.GetType().BaseType != typeof(Window)); return dpParen...

WPF combo box Image as tooltip

Dear friends, I am creating a WPF application which contains a combobox.When there is a mouse over on the combo box, suppose the combo contains the strings apple and orange, I need to show the corresponding image as a tooltip. I got a sample application from the following link. http://diptimayapatra.wordpress.com/2010/03/05/image-in-t...

WPF Checkbox style making focus border behave strangly

Hi All, I am using WPF with a style sheet. In my style I have been trying to customized the look of the dotted focus border for a checkbox. I need the focus border to only draw around the square an not the entire control. I set my style width to 15 and the dotted border is correct, but does not surround the square, its off to the side....

DataTemplateSelector to refresh on button click...

Hi, I have a DataTemplateSelector which I have attached to a cell in my list view. There is a button on each of the rows in the list view. When the user clicks on the button or double clicks on the row, I need to check for errors and update the row's appearance accordingly. How can I invoke my DataTemplateSelector based in the button cli...

WPF Optional Binding

I have an existing XAML file with some data templates in it. One of these datatemplate can be used in different situations. Therefore, I want to bind 1 of the properties only if a certain condition is true. What is the best way to achieve this? ...

How to check if a scroll is currently visible in WPF DataGrid?

How to check if a scroll (vertical or horizontal) is currently shown in WPF DataGrid? HorizontalScrollBarVisibility and VerticalScrollBarVisibility are used to set the behaviour and they are set to Auto. ...

Is it possible to detect in code behind to know if we are being in design/runtime mode?

Possible Duplicate: Is there a DesignMode property in WPF? I have some codes that run & cause trouble for the designer of the IDE when editing a WPF form. So I want to know if I'm in design mode, I will turn off my code. Is it possible? ...

Init grid row height doesn't work

Hi, this is my simple try-it application that create a grid with 2 rows. The 1st row's height is bound to a properties. The value I assigned to it only works at run-time. I tried to make it also work when design-time but I failed to do that (I used this thread to write my app). Please help me to see what I miss. Thank you! [Edit] The ...

Is there a way to quickly create a style from a set of selected attributes?

I currently want to create a wpf style by selecting a group of attributes, e.g. Height, Width of a button, then right click and call a command like "Generate style from selection" and the IDE will do the rest for me: add .Resource tags, and a Style with sample x:Key and put the attributes' names and values into Setter tags. Is it possib...

Refresh problem for combobox

I have a combox box which is bind with dependencyproperty My itemsource is bind to arraylist of string and the selectedValue to a string I want to modify the combobox context by code The first one is it OK but as i click in my comboxbox and after i want to change her contains it doesn' work My xmal <ComboBox Name="ComboCateg3" Sele...

Button inside a listboxitem ignoring clicks when its parent listboxitem is selected

I have a listbox whose listboxitem contains, among other things, a button, as follows: <DataTemplate x:Key="cDataTemplate" DataType="x:Type utils:cd"> <StackPanel Orientation="Horizontal" Background="Transparent"> <Button Style="{StaticResource LIButton}" x:Name="CButton" Command="{x:Static this:EditorComman...

MVVM Nested databinding

I'm having some trouble with databinding inside a UserControl when using an ItemsControl which has an ItemsSource. My Eventtrigger is never called. I Think the problem is that when I call my eventtrigger in the line: <cmd:EventToCommand Command="{Binding ElementName=layoutroot, Path=DataContext.Checked}" /> it tries to find the chec...

WPF menu - Intermediate menu item clickable.

Hi, I have a menu in wpf(mvvm). Menu is of three level. Level1 Level2_1 Level2_2 Level2_1_1, Level2_1_2, Level2_1_3 How do I make intermediate menu item clickable. I mean, I want to make "Level2_1" clickable. Example:- America California Kenucky Indiana ...

Getting a XamlParse Exception when using a userbaseclass with a UserControl

I have an abstract base class that subclasses the UserControl class with no XAML. When I create a class based on the base class everything works fine (compiles and executes). But when I add code to the base class to fire an event, it compiles but when run I get a 'The invocation of the constructor on type 'ExtendedDisplay.UserControls.An...

Silverlight control not stopping at container bottom

I have a grid that hosts a stackpanel that hosts a listbox. The Listbox once filled from the itemssource is stretching out of the visible area of the stackpanel. I have tried limiting the grid and stackpanel in size and the listbox continues to stretch out of the visible range (it just goes to edge and continues as if nothing was there...