wpf

WPF ComboBox IsSynchronised Default Value

I am trying to display a default value (or even NO value) when selected index is -1, or selecteditem is null. This normally works perfectly fine but when I enable IsSynchronizedWithCurrentItem and set it to True, the first value in my DataTable gets displayed. How can I have both IsSynchronizedWithCurrentItem ="True" and show no/default ...

Windows Forms or WPF - Remember User Profile on DataGridViews

Hi, I have some tab controls on a windows form. For each of these tabs I might want to be able to sort by the column header, apply a filter, change the order that the columns are displayed in, and also add additional columns from a predetermined list. The question I have is using Windows Form (Current Implementation) or making the tab...

Dependency Property In WPF/SilverLight

I have searched on google about how to get started with the dependency property used in WPF/silverlight but didn't get any idea of the dependency property, can any one tell me about it , from beginner point of view, so that I get some idea about it and use it in my project thanks in advance. Can any one give me link or code example of ...

Implementing IDataErrorInfo & databinding

I'm trying to change the IsEnabled property of a button if the validation on some of the textboxes in my form return true. So if there is errors, the IsEnabled property should be set to false. For some reason I cannot get it to work. The IDataErrorInfo implementation is only called after my IsEmailValid property is called, so the Vali...

How to handle right click event on a grid item in wpf?

I have used a list view that uses a grid view in WPF. I have bound the grid with data and I want to handle right click event on the items of the grid view. Can someone help me out and suggest how to do this?? ...

Convert C# Path object to XAML in WPF

I have a WPF Path object which is created by reading nodes from a binary file, however I was wondering if there was a way to take this generated Path and convert it into XAML that could be stored in the application resources. Thanks ...

WPF GroupBox HeaderTemplate and DataBinding

I define a headertemplate into a wpf groupbox and the databinding doesn't work. I don't understand why. <GroupBox> <GroupBox.HeaderTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" > <Image Source="/PopuAssuNetApplication.UI.Control;component/Images/Members.png" Width="24" /> ...

Missing images in FlowDocument saved as XPS document

I am having some difficulties getting images contained in a FlowDocument to show when the FlowDocument is saved as an XPS document. Here is what I do: Create an image using the Image control of WPF. I set the image source bracketed by calls to BeginInit/EndInit. Add the image to the FlowDocument wrapping it in a BlockUIContainer. Sa...

WPF, Treeview and kinda special herarchical Data Template

Hello I have been searching the internet for two days and wasn't able to find any solution to my problem. Here it is. I have a data structure in wich you can find "Curves" objects and "CurveTypes" objects. A CurveType contains a collection of other curvetypes (category/subcategories). A CurveType also contains a collection of Curves ...

WPF Toolkit Pie Chart Style Colors

Hello, i`d like to set colors in codebehind for every Pie Slice in my PieChart. Anyone knows how to do this? Now it gets the colors from the styles xaml, but i need to assign the colors for each value (pie slice) by myself from codebehind. ...

WPF ComboBox ControlTemplate Background IsMouseOver

I have the following style defined which is being applied (as text changes to red) but I cannot seem to get the Background property to work. Can anyone tell me what is wrong with this? <Style x:Key="CompanyComboItemContainerStyle" TargetType="ComboBoxItem"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Sette...

Populate StackPanel with checkbox's from Database

I am quite new to WPF. I have a page that displays data from a SQL database using L2S. The L2S returns a DataTable that contains all the available options to choose from for a specific area. Every row it returns from the DataBase needs to be a checkbox and I want to put those checkboxes in a stackpanel. Am I looking at databinding to...

WPF Toolkit Calendar takes two clicks to get focus

I am using the WPF Calendar that is part of the WPF Toolkit. I have two different calendars on a control. When I attempt to choose a date from one calendar and then from the second calendar, I have to click on the second calendar twice to get it to choose a date. Has anyone else had this issue and know of a solution? ...

Copy a ListView’s Items to the Clipboard in WPF C#

hello, how can I copy the selected items in a WPF's ListView with binding to db fields to the Clipboard? thank you Cristian ...

WPF ToolTip disappears on mouse down

I've got tooltip on an element that I want to stay open even when the user clicks or holds the mouse button down while over my element. Is there anyway to do this? ...

Tablet PC/WPF textbox bug - any workarounds?

I've just logged this with Microsoft Connect, but I'm wondering whether anyone else has come across it and found a fix. Google's not showing much... Simple repro: Application has a WPF textbox with MaxLength set Use the TabletPC input panel to write more text than is allowed Press "insert" on the TabletPC panel and the application cr...

WPF IsReadOnly property Binding

Hello there. Is there any way I can bind some datacontext's property value to the IsReadOnly property? e.g: <toolkit:DataGridTemplateColumn Header="MyColumn" Width="160" IsReadOnly="{Binding Path=BooleanPropertyFromMyViewModel, Converter={StaticResource InvertBoolConv}}"/> Or should I create a DataTrigger? ...

WPF DataBinding, CollectionViewSource, INotifyPropertyChanged

First time when I tried to do something in WPF, I was puzzled with WPF DataBinding. Then I studied thorougly next example on MSDN: http://msdn.microsoft.com/en-us/library/ms771319(v=VS.90).aspx Now, I quite understand how to use Master-Detail paradigm for a form which takes data from one source (one table) - both for master and detailed...

Drag and Drop Expander in WPF

I have a Expander as a ListBoxItem , I want to to add support for drag and drop the Expander item with in the Listbox. I found some nice tutorial from the following location. http://psiman.wordpress.com/2006/12/07/reordereablelistbox/ i implemented this in my project, but the problem is i am able to drag and drop only when the Expand...

System.Reflection.AmbiguousMatchException

Hi , I added Designer support for my control. I got the following exception when setting the property value like below. var colStyle = visibleColumn.Properties["PropertyName"].SetValue(Value); The same above code works fine for VS 2010 project but it shows the following exception for VS 2008 project InnerException: System.Reflectio...