databinding

Flex datagrid sorting not preserved across dataprovider changes.

I have a flex datagrid. it is bound to an array collection. if the user sorts on column X it works fine. then, if the user causes the array collection to change, the datagrid forgets that it was sorted on column X. what do I need to do to preserve this sort preference so that the new array data will appear sorted by column X? ...

How to bind to a property of the ViewModel from within a GridView

I'm using the MVVM design pattern, and the DataContext of my View is set to a ViewModel. In my View, I have a ListView/GridView with ItemsSource bound to a DataTable. One of the GridViewColumns has a CellTemplate that presents a Button. I want the IsEnabled property of the button to be bound to the SelectButtonsEnabled property of my Vi...

Tools for mapping bussiness objects(DTO objects) from entities in asp.net mvc?

is there any tool or utility(mapper assembly) to construct business objects from entities(which are obtained from DB using linq -> sql , entity framework or whatever..) in the absence of one , can anyone suggest the best way that can be accomplished rather can copy pasting the properties(what i'm doing right now) from the entity classes...

How to inform binding that property value has changed?

I have a class with a int property called X. I binded it to Left property of a textBox. But when I change my class X value, textBox does not move. What to do to inform binding that my property value has changed so that textBox will move right? ...

What to do so that TextBox Left change will update X value of binded class?

I have a TextBox and I change it's Left value. And this TextBox is bound to a class that have X property. Now when I change Left value of my TextBox I would like to have X of my class updated. What should i do to force update of my databound class property? ...

Custom Naming Container for ASP.NET GridView?

I'm looking for information on how to implement a custom naming container for the items in a GridView. My issue is that I have a GridView with a cell for each day of the week, and each cell will contain the same or similar controls. For the controls that are the same, it'd be nice to name them all the same, such as "lblPersonName". Ho...

ItemsPanelTemplate of a ListView throws apperently worngly an exception

Hello, I created a user control which contains a ListView with a custom ItemsPanelTemplate. <UserControl x:Class="..." xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="thisUserControl"> <ListView ItemsSource="{Binding Source={StaticResource cvs}}" N...

Visible='<%# UserCanEdit %>' – if set to true inside Page_Load, then control isn't visible

hi User control defines a property named UserCanEdit: private bool _userCanEdit=false; public bool UserCanEdit { get { return _userCanEdit; } set { _userCanEdit = value; } } This User Control also contains the following GridView: <asp:GridView ID="GridView1" runat="server"> <Columns> <asp:TemplateF...

Column of BindingSource with Anonymous Class as DataSource

Is there any method to select a column of the current row of a BindingSource whose DataSource is an anonymous class? var userResults = from u in dataContext.Users join c in dataContext.Computers on u.ID equals c.UserID where doSearch && u.Name.Contains(userNameTextBox.Text) && u.UserName.Contains(userUsername...

C# form custom textbox format binding

Hi, I haev an object with a DateTime property. I want to map the time to a textbox (thus want the user enter the time, it's directly reverberated to my property). However I just want to display the time. How can I say this (ie the format should be something like hh:mm to be correct). Less specifcly how can I format the text "sent" to...

Why does the WPF Databinding not update after the collection is Filtered?

Why does my WPF ContextMenu databinding not update as expected when the collection is updated, however the ItemTemplate is displaying the context menu text correctly? Within the code below this works when I don't try update the ObservableCollection. When the underlying ObservableCollection is updated the DataTemplate updates without pr...

Why is Databinding for a CheckedListBox "Hidden"?

The DataSource property on a CheckedListBox is hidden from Intellisense. Why? You can use the binding properties to make it work, but I'm worried that it's hidden for a reason and that I shouldn't be databinding on a CheckedListBox for some important reason that I'm not aware of. Is databinding on a CheckedListBox ok?? ...

Updating one dependency property from another

I have a string dependency property (SearchText), when updated, needs to update a collection dependency property (Results). My collection dp: public IEnumerable<string> Results{ get { return (IEnumerable<string>) GetValue(ResultsProperty); } set { SetValue(ResultsProperty, value); } } public static readonly DependencyProperty Result...

WPF ListView : Bind column Width of two ListView to each other ?

In my WPF application I have two ListView with identical columns. I want to bind the column width of the ListViews to each other. When I resize a column in one ListView I want the matching column in the other ListView to have the same width. It would be great if there would be no "Master"-ListView. Each ListView should update the other ...

A concise way to define properties for MVVM data binding in C# WPF

Is there a concise way to define properties in a ViewModel for data binding in C# WPF? The following property definition is very verbose, especially when there are lots of properties: private bool mSomeProperty; public bool SomeProperty { get { return this.mSomeProperty; } set { if (value != this.mSomeProperty) ...

BindingSource controls in WinForms - compared to LINQ , ADO.Net, etc?

I'm fairly new to database programming in WinForms, and have been using BindingSource, DataSet, and TableAdapter controls to display data from an Access database in grid and Component One Chart controls. The app is fairly simple right now - the user selects a row in the grid, and a related set of data points is plotted in the Chart cont...

BindingList<> ListChanged event

I have a BindingList<> of a class set to the DataSource property of a BindingSource, which is in turn set to the DataSource property of a DataGridView. 1. It is my understanding that any additions to the list will fire a ListChanged event which will propagate through the BindingSource and then onto the DataGridView, which will update it...

How to data binding two UI Elements so that they can update each other immediately in Silverlight?

Suppose I want to databinding two TextBox. I can do it in XAML: <TextBox x:Name="FirstBox" Text="{Binding Text, Mode=TwoWay, ElementName= SecondBox}"></TextBox> <TextBox x:Name="SecondBox"></TextBox> Or, I can do it programmatically. Binding binding = new Binding("Text"); binding.Mode = BindingMode.TwoWay; binding.Source ...

List Box databound problem

i bound the list box with data table.display member is "Code" and value member is "ID".no w i want to retrieve the all item of list box.but it return me system.data.datarow.how can i get all item from ListBox in this Case ...

Is there any way to temporarily detach a binding in WPF?

Background: I have a ListView/GridView with several columns. In some situations, only some of the columns are shown. Since there is no Visible property for GridViewColumns in WPF, I set the width of the columns I want to hide to zero. Visually, this achieves the desired effect (and I actually modified the ControlTemplate for the GridVie...