Click here to Skip to main content
15,569,408 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Dynamic WPF DataGrid Pin
Richard Deeming24-Mar-21 0:13
mveRichard Deeming24-Mar-21 0:13 
GeneralRe: Dynamic WPF DataGrid Pin
Kevin Marois24-Mar-21 7:14
professionalKevin Marois24-Mar-21 7:14 
QuestionWPF with TPL Multithreading Pin
#realJSOP16-Mar-21 7:04
mva#realJSOP16-Mar-21 7:04 
AnswerRe: WPF with TPL Multithreading Pin
Gerry Schmitz16-Mar-21 8:45
mveGerry Schmitz16-Mar-21 8:45 
GeneralRe: WPF with TPL Multithreading Pin
#realJSOP16-Mar-21 10:03
mva#realJSOP16-Mar-21 10:03 
GeneralRe: WPF with TPL Multithreading Pin
Gerry Schmitz16-Mar-21 11:11
mveGerry Schmitz16-Mar-21 11:11 
GeneralRe: WPF with TPL Multithreading Pin
#realJSOP16-Mar-21 11:51
mva#realJSOP16-Mar-21 11:51 
QuestionExpand/Collapse TreeView Nodes on Ctrl+LeftMouse in WPF Pin
ernie_hudds12-Mar-21 5:24
ernie_hudds12-Mar-21 5:24 
AnswerRe: Expand/Collapse TreeView Nodes on Ctrl+LeftMouse in WPF Pin
Gerry Schmitz12-Mar-21 9:13
mveGerry Schmitz12-Mar-21 9:13 
AnswerRe: Expand/Collapse TreeView Nodes on Ctrl+LeftMouse in WPF Pin
lmoelleb15-Mar-21 9:40
lmoelleb15-Mar-21 9:40 
QuestionAvalonDock using AvalonDock.ManagedContent not present in Dirkster.AvalonDock package Pin
sinagot4-Mar-21 2:24
sinagot4-Mar-21 2:24 
AnswerRe: AvalonDock using AvalonDock.ManagedContent not present in Dirkster.AvalonDock package Pin
Gerry Schmitz4-Mar-21 9:24
mveGerry Schmitz4-Mar-21 9:24 
GeneralRe: AvalonDock using AvalonDock.ManagedContent not present in Dirkster.AvalonDock package Pin
sinagot4-Mar-21 11:50
sinagot4-Mar-21 11:50 
QuestionDataGrid Columnm Header Style Pin
Kevin Marois16-Feb-21 15:44
professionalKevin Marois16-Feb-21 15:44 
AnswerRe: DataGrid Columnm Header Style Pin
Gerry Schmitz17-Feb-21 7:14
mveGerry Schmitz17-Feb-21 7:14 
QuestionGridView CellTemplate Pin
#realJSOP13-Feb-21 11:42
mva#realJSOP13-Feb-21 11:42 
So I have this ListView, and I want to make a specific column have a different font family, so I tried setting the CellTemplate for the column. Because of the architecture of the app, I have to apply this template in the C# code.

I tried :

- Creating a resource like so:
XML
<DataTemplate x:Key="PAScodeGridCell" >
    <TextBlock Text="{Binding}" FontFamily="Consolas" />
</DataTemplate>
and was setting it like so:
C#
column.CellTemplate = (DataTemplate)WpfCommon.Globals.XamlReaderLoad("PAScodeGridCell");
It found the template in the resource file, and set it to the CellTemplate property, but the font in that column wasn't Consolas.

Next, I tried so I tried specifying the template as a string in the c# code like so:
C#
readonly string _CELL_TEMPLATE_ = string.Concat( "<DataTemplate xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">",
																 "<TextBlock ",
																 "Text=\"{{Binding Path=PAScode}}\" ",
																 "FontFamily=\"Consolas\" /></DataTemplate>",
and set the property like so
C#
column.CellTemplate = (DataTemplate)XamlReader.Load(xaml);


The result was no different.

By all rights, both methods should have worked. I inspected the visual tree while the app was running and it's as if the specified template wasn't applied at all.

What am I don't wrong?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

AnswerRe: GridView CellTemplate Pin
Gerry Schmitz13-Feb-21 13:50
mveGerry Schmitz13-Feb-21 13:50 
GeneralRe: GridView CellTemplate Pin
#realJSOP13-Feb-21 14:13
mva#realJSOP13-Feb-21 14:13 
AnswerRe: GridView CellTemplate Pin
#realJSOP14-Feb-21 5:49
mva#realJSOP14-Feb-21 5:49 
GeneralRe: GridView CellTemplate Pin
Gerry Schmitz14-Feb-21 6:53
mveGerry Schmitz14-Feb-21 6:53 
GeneralRe: GridView CellTemplate Pin
#realJSOP14-Feb-21 9:41
mva#realJSOP14-Feb-21 9:41 
GeneralRe: GridView CellTemplate Pin
Gerry Schmitz14-Feb-21 11:48
mveGerry Schmitz14-Feb-21 11:48 
QuestionIcon Strangeness Pin
#realJSOP3-Feb-21 0:36
mva#realJSOP3-Feb-21 0:36 
AnswerRe: Icon Strangeness Pin
Richard Deeming3-Feb-21 1:12
mveRichard Deeming3-Feb-21 1:12 
GeneralRe: Icon Strangeness Pin
#realJSOP3-Feb-21 2:25
mva#realJSOP3-Feb-21 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.