If I have a WPF DataGrid that looks like this: <DataGrid x:Name="DataGridQ" AutoGenerateColumns="False" Grid.ColumnSpan="2"> <DataGrid.Resources> <Style TargetType="{x:Type DataGridRow}"> <Sette
I cant bind the variable from code behind in my wpf radiobutton Can anyone help me to display the values from the variables in the content from the radio button. MainWindow.xaml: <RadioButton GroupName="Preis" Grid.Row="10" Content=
Well, I have a data class with some data objects like this: private ObservableCollection<bool> check = new ObservableCollection<bool>(); public ObservableCollection<bool> Check { get { return check; } set { check = value; Notify("ch
For a project I am working on I am trying to save the contents of a WPF RichTextBox to a RTF file as the title states. I have it working for the most part. However, the file does not preserve newlines. When I save the file ( as you will see below ) i
Requirement I want to have ComboBox where user may enter some text or choose text from drop-down list. Binding source should be updated when user press Enter after typing or when item is simply selected from drop-down list (best View behavior in my c
How can I disable the first line of a TextBox in a WPF application? Is there a possibility?Put the first line of text into a separate disabled control.
I'm creating a control that allows the user to create a visual element that can be printed. The challenge is the user can change the size of visual but needs to know the actual size of the visual they are creating. In other words I have the size of t
I'm using "Simple MVVM Toolkit" (MVVM noob here) to develop a C# WPF app. I have a model class called A: public class A : ModelBase<A> { //properties, constructors, methods.. } ..and another model class called B which inherits from A but e
I have a defined list box like this: var listBox = new ListBox(); listBox.Items.Add(1); listBox.Items.Add(2); listBox.Items.Add(3); And I want to set focus directly to an item in the listbox. If I do this: listBox.SelectedIndex = 0; listBox.Focus();
I want to be able to display and change the values of ObservableCollection<> in UI. Does it possible? I display it with ListView but I can't change them.You could use a DataGrid instead of a ListView. DataGrid allows cell edition.
(using WPF) Is it possible to use the number of a TextBox to select the parameter name? For example, the user can put 0,1,2 or 3 as text in the TextBox: private void button1_Click(object sender, RoutedEventArgs e) { int test = int.Parse(textBox1.Text
now I'm using the tabcontrol to arrange my UI. At the first, I put my button outside my tabcontrol; however, when I put the button into the tabcontrol, it gave message, Object reference not set to an object instance. Does anyone know why I got this m
Is there any standard method for showing dialog windows, opening and closing them and retrieving data from them, using the MVVM pattern? I have seen this:http://www.daedtech.com/mvvm-and-dialogs I want use for show a dialog for special (View/ViewMode
I made a WPF app that opens successive windows based on user interaction. For example, the first winodw asks what module the user wants to work on, when a selection is made and a button pushed, a new windows open showing some Vendors and summary coun
I have: private void button1_MouseEnter(object sender, EventArgs e) { for (int i = 0; i > 2; i++) { button1.Content = Convert.ToString(i); System.Threading.Thread.Sleep(1000); } tekst.Text = "Mouse Enter"; } When I enter on Button I see only
Is it possible to add a character to the assembly version? ex 10.1.1.1a ?No. Assembly versions (specified by AssemblyVersionAttribute) follow the System.Version system, which is strictly four numbers. However, you can use AssemblyInformationalVersion
I have a custom converter that I want to make use of in xaml. The converter just places Admin if value is equal to 0, Cashier if it is equal to 2 etc.. Anyways this is what I am looking for. <ComboBoxItem Content="{Binding 'I want to place the val
I have been trying to do this for ages and having no joy whatsoever. I have a ribbon window of the following hierarchy: MainWindow MainContent (Tab Control) TabContainerViewModel ViewModelBase View model base has an ObservableCollection of tabs type
I'm trying to trigger an event when the user presses ctrl-x using the KeyDown event. This works fine for ctrl-D but the event doesn't trigger when ctrl-x is pressed. I'm guessing this is because ctrl-x is the "cut" command. Is there any way to t
I have the following sample code in WPF. It is working well when I put the xaml and corresponding C# code inside windows, but when I am using a user control, the databinding doesn't work. why? Here is the code: User control XAML: <UserControl x:Class
I have a TextBox control defined in XAML and I want to apply different background colors to the TextBox based on its IsReadOnly or IsEnabled properties. I used dataTriggers to actually switch between the colors as shown below: <Style x:Key="TextBo
I have a wpf datagrid (.NET 4.0) that contains raw data from a database, and some of the fields need to be formatted to display in a meaningful manner, for example 3 fields containing Year / Month / Day could be formatted together to produce a proper
Is it possible to open a WPF Application from a C# Windows button click event?You can launch it like any other applicaiton. Use the Process.Start method. If you need more control, you can create an instance of the Process class (Process process = new
I'm trying to display the Title of an Tabitem in his contentpresenter. Is there a possibility to get this name? For example in the Tabcontrol Template something like <Label> <ContentPresenter ContentSource="SelectedContentHeader" Grid.R
A Context Menu automatically closes when the user clicks outside of it. Is there a way to stop it from closing ? I tried setting the StaysOpen property to true but failed to get the desired result. Thanks for any help!A bit unclear what you are tryin
What are the responsibilities of one vs the other? What kind of logic should go in one vs the other? Which one hits services and databases? How do I decide if my code should go in the viewmodel or the controller? for the record, I am using asp mvcIt'
I'm completely new to databinding in WPF, and I'm trying to bind an object property to a textbox. My object is public class TestObj { private m_Limit; public string Limit { get { return m_Limit; } set { m_Limit = value; } } My XAML looks like <Window
I have a ComboBox in WPF whose ItemsSource is set to a list programatically. How would I go about clearing the selection in an event handler? I've tried: comboBox.SelectedIndex = -1; comboBox.SelectedItem = null; comboBox.SelectedValue = null; comboB
I'm trying to accomplish the following in ASP.Net: Create a WPF Canvas control Spin up a WPF Image control and a BitmapImage object Set the BitmapImage source to a Uri for an image Add the image to the canvas When the image is downloaded render the c
I have a borderless and transparent window in WPF, with some fancy decoration at the bottom. There's a custom footer with some non conventional curves and what not showing the company logo. This window needs to be resizable with a grip in the bottom