Search Results

Search found 9 results on 1 pages for 'kristrip'.

Page 1/1 | 1 

  • WPF Toolkit DataGridCell Style DataTrigger

    - by KrisTrip
    I am trying to change the color of a cell to Yellow if the value has been updated in the DataGrid. My XAML: <toolkit:DataGrid x:Name="TheGrid" ItemsSource="{Binding}" IsReadOnly="False" CanUserAddRows="False" CanUserResizeRows="False" AutoGenerateColumns="False" CanUserSortColumns="False" SelectionUnit="CellOrRowHeader" EnableColumnVirtualization="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> <toolkit:DataGrid.CellStyle> <Style TargetType="{x:Type toolkit:DataGridCell}"> <Style.Triggers> <DataTrigger Binding="{Binding IsDirty}" Value="True"> <Setter Property="Background" Value="Yellow"/> </DataTrigger> </Style.Triggers> </Style> </toolkit:DataGrid.CellStyle> </toolkit:DataGrid> The grid is bound to a List of arrays (displaying a table of values kind of like excel would). Each value in the array is a custom object that contains an IsDirty dependency property. The IsDirty property gets set when the value is changed. When i run this: change a value in column 1 = whole row goes yellow change a value in any other column = nothing happens I want only the changed cell to go yellow no matter what column its in. Do you see anything wrong with my XAML?

    Read the article

  • DPI for EMF files

    - by KrisTrip
    Do EMF files have a DPI that can be set? I have an application that allows saving an image in multiple formats (including EMF). I allow the user to specify the resolution/DPI for the image(s). However, I cannot find a way to do this for a MetaFile in C#. Is this possible or does EMF not have a DPI since it is a vector graphics format?

    Read the article

  • C# double-quoted path name being escaped when read from file

    - by KrisTrip
    I am trying to read in a text input file that contains a list of filenames (one per line). However, I am running into an issue if the user double-quotes the path (because it has a space in it). For example, a normal input file might have: C:\test\test.tiff C:\test\anothertest.tiff C:\test\lasttest.tiff These get read in fine by my code ("C:\\test\\test.tiff" etc) However, if I have the following input file: "C:\test with spaces\test.tiff" "C:\test with spaces\anothertest.tiff" "C:\test with spaces\lasttest.tiff" These get read in double-quotes and all ("\"C:\\test with spaces\\test.tiff\"" etc). This becomes a problem when I try to open the files (I understandably get invalid character exceptions). My question is, how do I fix this? I want to allow users to input quoted strings and handle them correctly. My first impression was to just write a little method that strips off beginning or ending quotes, but I thought there might be a better way.

    Read the article

  • Binding to TreeView in WPF

    - by KrisTrip
    I am trying to bind some data from a class instance to a TreeView. My code is as follows: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Parent myClass = new Parent(); this.DataContext = myClass; } } public class Parent { public String Name; public List<string> Children = new List<string>(); private static int count = 0; public Parent() { this.Name = "Test"; for (int i = 0; i < 10; i++) { Children.Add(i.ToString()); } } } And the XAML: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:loc="clr-namespace:WpfApplication1" Title="MainWindow" Height="287" Width="525"> <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch"> <TreeView Name="TreeView" ItemsSource="{Binding}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Children}"> <TextBlock Text="{Binding Name}"/> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView> </StackPanel> </Window> Nothing shows up in my TreeView. What am I doing wrong?

    Read the article

  • Accessing another project's settings file

    - by KrisTrip
    Is there a way to access the settings file from a different project? For example, I have a solution that contains 2 projects (Lets call them Proj1 and Proj2). I want to access the application settings of Proj2 from Program.cs in Proj1. Is this possible?

    Read the article

  • Displaying multidimensional data in WPF

    - by KrisTrip
    What is the best way to display multidimensional data in WPF? I want to use databinding and I won't know the size/shape of the data until runtime. I was thinking some sort of grid but I don't know how to dynamically bind to the data and have it figure out the number of rows and columns. Suggestions and examples please?

    Read the article

  • WPF Trigger when Property and Data value are true

    - by KrisTrip
    I need to be able to change the style of a control when a property and data value are true. For example, my bound data has an IsDirty property. I would like to change the background color of my control when IsDirty is true AND the control is selected. I found the MultiTrigger and MultiDataTrigger classes...but in this case I need to somehow trigger on data and property. How can I do this?

    Read the article

  • Set Validation Tooltip in CodeBehind instead of XAML

    - by KrisTrip
    I would like to know how to translate the following code to codebehind instead of XAML: <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/> </Trigger> </Style.Triggers> The part I can't figure out is the Path portion. I have the following but it doesn't work: new Trigger { Property = Validation.HasErrorProperty, Value = true, Setters = { new Setter { Property = Control.ToolTipProperty, // This part doesn't seem to work Value = new Binding("(Validation.Errors)[0].ErrorContent"){RelativeSource = RelativeSource.Self} } } } Help?

    Read the article

1