databinding

Thread safety when updating data bound objects from non UI thread (WPF/Silverlight)

This may be seen as a duplicate of http://stackoverflow.com/questions/3423248/thread-safety-lists-binding-and-wpf, but I post it anyway since I'm not fully happy with the accepted response, and I might be able to express what I suspect is the same question more exactly. Any operations related to UI in WPF/Silverlight must be performed o...

Silverlight 3 Element binding in a datatemplate

Hi, <DataTemplate x:Key="StatusColumnTemplate"> <Canvas> <Rectangle Fill="Red" Canvas.ZIndex="1" Opacity="30" Height="{Binding Value, ElementName=Stacky}" Width="{Binding Value, ElementName=Stacky}"></Rectangle> <StackPanel x:Name="Stacky" Orientation="Horizontal"> <Image Height="16"...

WPF. Find control that binds to specific property.

Any ideas on how to implement a method that given a propertyname, finds a control (perhaps from a visualtree) which is bound to the given property? ...

Better than TreeView

I'm binding a lot of data to a TreeView control as the data is a natural category hierarchy. The problem is that there is a lot of it. I have managed to remove a lot of the overhead by only binding those nodes which appear in the visible tree, but this still leaves a lot in the ViewState, et al. Does anyone have a method or alternative ...

Silverlight 4 Binding to List of List of objects

Hello, someone can suggest how I can do it? I have a public static int _index in App.xaml.cs I have a List < List < Person > > foreach List < Person > I create a new button -> foreach button, the click.event of it opens a PopUp. Now I want to bind the Textboxes of the PopUp to the person-propertys For example: P...

Polyline using DataBinding and PointCollection for continuous update

Hi there, first of all I describe my objective I want to achive. I want to visualise a continuous data stream (maximum 1000 values per second but could be reduced). This data stream should be visualised as a chart - being more precise it's a visualisation of an ECG among other things. My first idea was using polyline and bind it to a po...

WPF DataBinding - Changing ComboBox's SelectedItem not calling ViewModel

The following code is not calling the SelectedItem's property setter in my view model. <ComboBox x:Name="cmbGuaranteeType" Margin="5,5,5,5" MinWidth="80" ItemsSource="{Binding Source={StaticResource guaranteeTypesKey}}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpfToolkit:DataGridR...

Generic table editor

Hello, I have about 40 tables and users should edit data in this tables in browser. I believe than it's possible to create one page with dropdown, user select table name in this dropdown and get a grid with "Edit" button. Does anybody know if such possible? Is it ready projects on Codeplex for such task? Thanks, asp.net developer ...

Embed a TDataSet in a Form at Design Time

I am looking for a way to provide a ListSource to a TDBLookupComboBox in delphi without having an actual table on the database server to draw that list from. The DataField for the Combo Box is a 1 character field that contains a coded value such as 'A' = 'Drivers License', 'B' = 'Passport', 'C' = 'Library Card', etc. That is to say that ...

Deleting bound item from DataGridView

I have a List of an object, set to DataSource of a BindingSource, set to DataSource of a DataGridView. Then I added a DataGridViewButtonColumn which I want a click to remove that record from the collection. So I simply call collection.RemoveAt(e.rowIndex) from the DataGridView CellClick event. However this produces an IndexOutOfRange Exc...

Silverlight TwoWay-bound ComboBox setting values to NULL

Before I explain my issue, consider the following object: Character.cs -> AnimationControlSettings.cs .. -> UpControlType (string) .. -> AvailableControlTypes (List<string>) The relevant properties in my ViewModel: Character SelectedCharacter ObservableCollection<Character> Characters I have a simple View where you select a ch...

Binding the combobox in C# desktop application

Hi there, I am working on a project for my college where I need to bind data from database into the combobox. I need to store the roll no / enrollment no in the "value" field of combobox and name of the student in the "text" property of the combobox. How can I do that?>??? Please reply ASAP.... ...

ASP.NET - User control custom data binding

I develop user control Date of Birth, which contains 3 DropDownList. I need to make data binding, but I dunno how. public partial class DofControl : System.Web.UI.UserControl { public const int YearsCount = 100; int _year; Months _month; protected void Page_Load(object sender, EventArgs e) { ...

Populating Combobox from database dynamically

Hi there, I am working on a project for my college where I need to bind data from database into the combobox. I need to store the roll no / enrollment no in the "value" field of combobox and name of the student in the "text" property of the combobox. My code is : #region Fill Combo Box //Fill Combo Box. public static vo...

How do I avoid 'Binding to Large CLR Objects'?

This guide on optimizing DataBinding says: There is a significant performance impact when you data bind to a single CLR object with thousands of properties. You can minimize this impact by dividing the single object into multiple CLR objects with fewer properties. What does this mean? I am still trying to get familiar with DataBin...

wpf databinding to a property of same control

I have a control (let's say a textbox) and I want bind the value of one property (let's say tooltip) to value of another property in same control(let's say text). i want something like belowing but I dont know how can I bind the tooltip to text of same control : <textBox text="abc" tooltip={Binding ???} /> ...

Which control to use

Hi! I'm designing a data driven website, the content for which is displayed mostly with Repeater controls. I'm not sure, though, how to present the content that won't be repeated (such as articles). I had thought about using Labels and creating a DataSet when the page loads and populate the Labels on the page with columns from the Data...

How to prevent a ModelBinder error in a mandatory fields of a list?

I've got this object created from EntityFramework from my database. [EdmEntityTypeAttribute(NamespaceName="ContactCoreModel", Name="TargetLang")] [Serializable()] [DataContractAttribute(IsReference=true)] public partial class TargetLang : EntityObject { #region Factory Method /// <summary> /// Create a new TargetLang object...

Eval/Bind TimeOfDay property without milliseconds?

Hi all, I'm trying to format the following: <%# Bind("TimeOfDay","{0:HH:mm:ss}") %> <%# Eval("TimeOfDay","{0:HH:mm:ss}") %> <%# Bind("TimeOfDay","{0:HH:mm:ss tt}") %> But using either of those returns time as following: 08:33:08.1430000 How can I only get the 08:33:08 part? Thanks, EtonB. ...

How to bind images to a Combobox in WPF, getting the images from a lookup.

I have a WPF combobox that I would like to bind to an observable collection of Teams on my ViewModel class e.g. class Team { public int Id { get; set; } public string Name { get; set; } public int CountryId { get; set; } } class ViewModel { public ObservableCollection<Team> Teams { get; set; } public IDictionary<int, Image...