Suppose I have a ListView and TextBox and they are located
in different containers in the same Window.
Selecting items in the listview I want the TextBox Text property to be updated
in accordance with the listview data bound selected item.
Is it possible in XAML?
...
I'm beginning with WPF and binding, but there are some strange behavior that I don't understand.
Exemple 1 :
A very simple WPF form, with only one combobox (name = C) and the following code in the constructor :
public Window1()
{
InitializeComponent();
BindingClass ToBind = new BindingClass();
ToBind.My...
I have an ASP.NET MVC app in which I am iterating through a Linq result set. Each row in the result set contains a property which is an EntitySet itself. When I try to iterate through the inner result set, I get an error message: "Invalid object name EntitySetOfSubItem" when trying to load the page. How do I process this collection?
<% ...
I have a WinForms combobox to which I bind a list of anonymous objects (printer descriptions and locations).
The goal here is a to select a default printer (which matches printer location).
But within a foreach loop below, I am having trouble accessing the anonymous object's properties.
I know of a work-around (I tried a private nes...
I have a bit defined in my database 0=no, 1=yes. I have a silverlight combo with the values "Yes" and "No" in it. How can I bind my bit value to the combo?
...
When creating a custom IValueConverter for a user-editable field, the Convert implementation is usually fairly straightforward.
The ConvertBack implementation is not, since (in the absence of an explicit validation rule) it has to cope with bad user input (eg. typing "hi" in a numeric input field).
If an error occurs during conversion,...
Hi,
Ok. This is a tricky one: (for me at least)
I have a datagrid. A column of the datagrid is a simple <DataGridTemplateColumn> with its CellTemplate containing a <DataTemplate> which contains a <ComboBox>
<my:DataGrid Name="dataGridMain" AutoGenerateColumns="False">
<my:DataGrid.Columns>
<my:DataGridTemplateColu...
I am trying to create a static property, and the only way I could find to do it, is using DependencyProperty.
I have created the following fields in my class :
public static readonly DependencyProperty UnreadMessagesProperty = DependencyProperty.Register("UnreadMessages", typeof(int), typeof(ErrorLog));
public int UnreadMessag...
Hello,
Excuse me for my poor English, that is not my native language.
I'm a beginner (since 3 days) with WPF and LINQ, and a casual user of C#.
Yesterday, i've trying all the day to solve my probleme and read several documentation, but a bug in my code persist.
I pass a XElement to a control who bind its content, but i've a but in th...
My code keeps throwing a DBConcurrencyException ("Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.) when I make a second update to the data table.
The problem actually happens on a table that is linked to a parent table. The two tables, CashReceipts and CashReceiptsApplyTo are displayed on the same winform,...
I need someone to confirm what I am seeing before I may a change to the domain of the application because of this issue. The issue is that when databinding against interfaces that inherit from one another, you can not see the properties on the base interfaces.
I am working on a WinForms application that uses databinding. This is in .net...
Hello,
I would like to have some convenient way to edit my objects, that are EntityObject or some other ones. I want only to provide 2-sides binding and then update the object in DB on myself. Unfortunately I cannot use DetailsView control because it requires datasource as IEnumerable whereas I have simple EntityObject. The using of Obje...
Is it possible to have the controls on a canvas be bound to a list of objects? I am thinking something like this:
<UserControl.Resources>
<DataTemplate x:Key="MyItemTemplate">
<ContentControl Content="{Binding Converter={StaticResource MyControlConverter}}"></ContentControl>
</DataTemplate>
</UserControl.Resources>
<Can...
Hello
I am using a CollectionViewSource in a dialog view model that has various filtering requirements, which works fine. I also maintain the equivalent of the selected item in a property (SelectedProject), and I'm wondering if I could / should do away with it since the View will know the current item. My data binding looks like:
<L...
This feels like it should be such an easy solution, but I think I'm crippled by thinking about the problem in WPF terms.
In my view Model I have patterns where a container has a collection of items (e.g. Groups and Users). So I create 3 classes, "Group", "User" and "UserCollection". Within XAML, I'm using an ItemsControl to repeat al...
Hi there
I'm trying to databind to an ExpandoObject. I'm getting the following error:
System.Windows.Data Error: 17 : Cannot get 'Dimension2' value (type 'Object') from 'Dimensioner' (type 'ExpandoObject').
BindingExpression:Path=Dimensioner.Dimension2; DataItem='Bogføringslinje' (HashCode=10586695);
target element is 'TextBlockCombo...
Hi,
I have a TreeView that is bound to a XmlDataSource control. I've added some TreeNodeBinding elements to define how I want the XML data to be shown.
I have also added PopulateOnDemand=true to these TreeNodeBindings. However, doing so didn't change a thing and the entire XML tree is displayed. Moreover, the TreeNodePopulate event is ...
How can I get asp.net to two-way databind (via Bind("myfieldname")) to a Byte value? I'm storing boolean values in Sql Server to a Byte type and it seems to be looking for boolean. Apparently I need something to convert my datasource's Byte
Looked into creating a method to call like MyConvertMethod(Bind("myfieldname")) but asp.net 4.0 d...
Hi
Here is my problem:
I have DataGridView. It's source is set to the BindingList of my business objects.
Business object implement INotifyPropertyChanged interface. Each time the business object changes DataGridView fires several SelectionChanged events. When I add/remove objects to the DataSource SelectionChanged events are fired too...
In my continuing journey through ASP.NET MVC, I am now at the point where I need to render an edit/create form for an entity.
My entity consists of enums and a few other models, created in a repository via LINQtoSQL.
What I am struggling with right now is finding a decent way to render the edit/create forms which will contain a few dro...