WCF Data Contracts DTO
In my application I am making a service call and getting back populated WCF Data Contract object. I have to display this data in a grid. Is it good practice to bind the data contract to the grid ? Josh ...
In my application I am making a service call and getting back populated WCF Data Contract object. I have to display this data in a grid. Is it good practice to bind the data contract to the grid ? Josh ...
Hi, I want to bind a combo box to a list of Device, List. I use, m_ctrlCB.DataContext = m_List; m_ctrlCB.DisplayMemberPath = "ToString()"; m_ctrlCB.SelectedValuePath = "ToString()"; // do I even need this? I don't have any properties in Device to bind to and it's not my class. However, they do override ToString to something that i...
I've got a custom ItemsControl in my project and I'm trying to write a style for it that combines a static list of items with a list of items on a Dependency Property on the control itself. Here is the respective XAML in my Resource Dictionary: <x:Array Type="{x:Type System:Object}" x:Key="Static_CloudItems"> <Button>One</Button> ...
I have a ViewModel whose properties are bounded to from the View (XAML file). I also have a property "StaticText" in the code behind file. how can I access the property "StaticText" from inside the ViewModel ? as suggested by Cameron, i've created a dependency property in my View : String textToTest="I am just testing ."; pu...
Hello Stackoverflow users, What I am trying to do is to create some sort of "rooms"(like a chat group, a sharing center or whatever you want). All the room are created the same way, but each one of them contains different informations. Each of these rooms is contained in a TabItem. I managed to create dynamically all the Tabitems, to gi...
Hey everyone! I suppose this is my first post on StackOverFlow.com :-) I've been having this problem for a while. To make it all simple, suppose we have 2 database tables named "books" and "categories" with the following schema: books(id, title, catId) categories(id, catName) Obviously the "catId" field in the "books" table is a...
I have following xaml code: <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" DataContext="{Binding MainWindow, Source={StaticResource Locator}}"> <Window.Resources> <DataTemplate DataType="{x:Type vm:...
I am a newbie .net programmer learning WPF for past one month. One thing I am confused from the start is how real time data driven applications are built. I started with a basic application where I required to bind data to a datagrid which would have some 10 columns approxly. The common way of data binding I have seen in all the tutorial...
I've been battling a "slow" WPF ComboBox this morning, and would love to see if anyone has tips for debugging such a problem. Let's say I have two ComboBoxes, A and B. When A changes, the items in B change as well. The ComboBoxes each have their SelectedItem and ItemsSource databound like this: <ComboBox Grid.Column="1" ItemsSource="...
I've a custom property on a user control which has multiple state/modes. If this property is set in the parent page: I would like for my control to update automatically. Using the property in the page load does not work because it is not initiated. I can imagine 3 methods to do this: On the property, I could add a code block that woul...
In XAML (or code) is there a way to default the UpdateSourceTrigger to PropertyChanged for all bindings? http://msdn.microsoft.com/en-us/library/system.windows.data.binding.updatesourcetrigger.aspx http://msdn.microsoft.com/en-us/library/system.windows.data.updatesourcetrigger.aspx ...
I think the title pretty much captures my question, but a little bit of background follows: When a form I have loads it adds a couple of thousand (30k odd) objects to a binding list. When my application loads the first time it takes multiple seconds (around 10 or so from memory) for it to loop through the list of objects and add it to t...
I have a DataGrid that I have bound to a property: <cd:DataGrid Name="myDataGrid" ItemsSource="{Binding Mode=OneWay,Path=Thingies}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> ... When the Thingies property changes, once all rows in the DataGrid have been populated with the new contents o...
Hello, Quick question, is it possible to bind a combobox to a list of objects, but have the selectedvalue property point to the object, not a property of the object. I only ask because we have some Business Objects which have references to other objects - such as a 'Year' object. That year object may need to be switched out for another...
I have a problem with nested StackPanels. If I define StackPanels like in the code below, button binds to command (MVVM and command pattern) but doesn't react on button click (command function is not called). When I put stackPanel4 on second position (below stackPanel3) everything works ok. When I move stackPanel4 on the last position (I...
Hi there, I've been trying to resolve this issue for some time. I'm trying to bind a TextBlock's text to a string property using the INotifyPropertyChanged interface. For some reason the PropertyChangedEventHandler is always null when the value of the property is changed thus the target never gets updated... Any suggestions? Code below: ...
I have a ToggleButton with its IsChecked property bound to a property using a OneWay binding. <ToggleButton Command="{Binding Path=SomeCommand}" IsChecked="{Binding Path=SomeProperty, Mode=OneWay}" /> The SomeCommand toggles the boolean SomeProperty value, and a PropertyChanged event is raised for SomeProperty. If I change So...
I want to bind a Telerik RadGrid to a web service without using Linq. In all examples I can find, the web service has to return a List(Of MyObject); I've tried this, and it works great. However, the table I'm binding to may at runtime have additional columns, or columns may have different data type, so I can't use a static MyObject class...
I have a simple custom control that boils down to a label and a listbox. Selections in the listbox are reflected in the label as comma separated values. My question is what is the best and simplest way to make the page developers experience of working with the custom control exactly mimic the experience of working with just the listbox...
I have a Linq to SQL dbml.cs file with this in it: [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PantsName", DbType="VarChar(248)")] [global::System.Runtime.Serialization.DataMemberAttribute(Order=3)] public string PantsName { get { return this._PantsName; } set { if ((this._PantsName != value)) { this._PantsName = val...