I am trying to set the DataTemplate of my ListView.GridView's CellTemplate dynamically at runtime.
The problem is when I do this, nothing happens. I checked the CellTemplate and it's not null but its VisualTree property is null.
Any suggestions?
GridViewColumn gvc = new GridViewColumn
{
Header = col.Label ?? col.Name,
...
If have a WPF datagrid on the left of a Window with an area to the right for displaying the selected record. The selected record consists of Textboxes and ComboBoxes that are disabled until the edit button is clicked. All works as expected.
However, it seems a bit clumsy to be populating ComboBoxes when the SelectedItem of the DataGrid ...
Ok, so I have a general question about WPF. I've messed a little with ASP.NET MVC and in the markup it has intellisense on your viewmodel object so you don't mistype it( i love it).
Enter WPF, I love it, I'm utilizing the MVVM approach and one annoying thing that I have to do is make sure I'm binding correctly to my viewmodel. So I type...
I have a WPF xaml file describing a section of a GUI and I'd like the enabling/disabling of a particular control to be dependent on two others. The code looks something like this at the moment:
<ComboBox Name="MyComboBox"
IsEnabled="{Binding ElementName=SomeCheckBox, Path=IsChecked}"/>
But I'd like it to be dependant on anot...
I have a WPF ScrollViewer, and I would like to get to the ScrollContentPresenter of it's template.
...
I have a global style that sets all my TextBox styles, but in some cases I want to revert just the Foreground color to the original non-custom-style color. I tried using {TemplateBinding Foreground} inside the specific TextBoxes that I wanted to revert. It didn't end up being valid XAML and I'm not sure that's the right way anyhow.
An...
Hi,
I was learning about routed events in wpf and I tries the following example,
File -- Window1.xaml
<ScrollViewer VerticalScrollBarVisibility="Auto">
<UniformGrid MouseDown="UniformGrid_MouseDown">
<Button x:Name="Button1">1</Button>
<Button x:Name="Button2">2</Button>
<Button x:Name="Button3">3</But...
Hi!
I use WPF UserControls to design some part of my application. I'm using blend 2.5 for the graphical part. But when I have a user control into any content, it won't show up in blend and a, exception will be raised, saying that the resource couldn't be located.
My application is localized, I moved my localized DLL into Blend folder.
...
Hi,
I have what I believe to be about one of the most simple cases of attempting to bind a view to a dependencyproperty in the view model. It seems that the initial changes are reflected in the view but other changes to the DP do not update the view's TextBlock. I'm probably just missing something simple but I just can't see what it is. ...
Hi. I have a WPF ListView with a column that has dates in it. I would like a way to custom sort the dates (by date value, rather than string value). Is there a way to do this? Right now I am using list.Items.SortDescriptions to sort using another column, but I would like to change this to sort on the date column instead.
Thanks.
...
Using WPF how can I do similar thing as done in Skype contacts window? I want to be able to press on any list item with mouse, be able to use Up/Down to navigate and filter contacts when I start typing. I also want to show what I'm typing in separated TextBox.
So far I have all filtering set up through TextBox. I can navigate with arro...
How do I make a Canvas Stretch fully Horizontally with variable width? This is the Parent Canvas, so it has no parents, only Children.
XAML Source: it displays in blend
http://resopollution.com/xaml.txt
...
In ASP.NET I could make a user control to occupy more than one cell in a table on the page:
UserControl1:
<tr>
<td>foo</td>
<td>bar</td>
</tr>
Page1:
<table>
<put a UserControl1 here/>
<put another UserControl1 here/>
</table>
and the column widths adjusted automatically to fit the largest user control.
Can this be done i...
If I have a ResourceDictionary in one project, is it possible to create another project that uses resources defined in the first project? Note that both projects are WPF Applications, not ControlLibraries.
Thanks!!
...
Most common way I encountered of specifying a value converter for a binding is to:
1. Create an instance of the value converter as a resource with a key.
2. Reference the instance using StaticResource markup extension:
<TextBlock Text="{Binding Converter={StaticResource myFormatter}" />
Q: Is there anything wrong with using static ins...
Is there an easy way to change header font size without overwriting completely duplicating ColumnHeaderTemplate?
Note: Not sure if it is relevant, but I use an application theme (PresentationFramework.Royale) which provides the ColumnHeaderTemplate.
...
I have a simple listbox with extended selection mode. Selection works almost perfectly fine like it works in explorer. But deselection doesn't really work all that well. What I want is that when I click on something outside the range of elements in the listbox I want all elements to be deselected. I doesn't seem to behave that way by de...
How do I force UserControls in WPF that are inside a ToolBar to use the ToolBar's default button style?
I have a simple user control called ImageButton which has XAML something like this:
<UserControl x:Class="myNameSpace.ImageButtonUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://s...
The problem is that I need to change Label FontWeight and FontStyle programmatically but nothing seems to work... this is what I've tried so far:
label.FontWeight = FontWeight.FromOpenTypeWeight(99);
For label.FontStyle I have no idea, I got stuck here:
label.FontStyle = new FontStyle();
I have no idea what to do from there on. I g...
I'm working on creating a CheckedComboBox WPF control. I want to add a SelectedValuesProperty that I could bind through via XAML. I've tried a few different things and haven't been able to get it to work yet. Does anyone have any suggestions on how to approach this? My control inherits from MultiSelector. Thanks in advance!
This is ...