databinding

WPF - Databind dynamic control type

Hi, I have a Person class. A Person can have an associated control. Can I display the control through data binding? e.g: Name: Bill , Control: TextBox Name: Bob, Control: ComboBox Name: Dan, Control: CheckBox I have the following xaml in my resource dictionary <DataTemplate x:Key="PersonTemplate"> <DockPanel > ...

Cancelling databound control validating event doesn't suppress attempt to update data source. winforms, .net

I'm not getting the behaviour I would expect for a TextBox bound to an integer property in a business object. Here's what I did: (1) Set the DataSourceUpdateMode, for the TextBox to: OnValidation. (2) In the Validating event for the TextBox, set e.Cancel = True if Integer.TryParse fails. (3) Add a handler to Binding.Parse and Binding...

WPF Height Databinding question

I have an ScrollViewer that I am trying to do data binding on the height of. The ScrollViewer holds a long ListBox So here is my question. My ScrollViewer will bind to the height of my window (Name="MainForm") just fine. But then it is too long. If I try to bind to a grid in the window (Name="MainGrid") then the ScrollViewer expands...

WPF Dynamic Binding

Today, I was working on a WPF UserControl to display the current value of a few variables. I was wondering if there would be a way to make a super simple property grid in WPF. The problem is on the starred line of the XAML below. How would I bind a string to a property with an ItemTemplate like I have setup below? To be more clear ca...

BindingSource sees changes, DataTable doesn't

I have recently switched over from Java/RMI to C# / .net, and am working on my first project using databinding to update records in Oracle. On this first form I'm building, I have a detail view for vehicle records (VIN, year/make/model, license plate number, that sort of thing). The first thing I did in terms of writing to the DB was s...

Injecting an object created by OjbectBuilder as a property to view

I have a PresentationModel AS class that holds all the values used in SomeView.mxml. The entire class for the model is bindable, and the model property in the view is also bindable. However, I am unable to inject the model into the view using the PropertyInjector tag: - INFO: Data binding will not be able to detect assignments to model...

Can I declaratively bind an ItemsContol.ItemsSource to an ObservableCollection in Silverlight?

I can't for the life of me figure out why this doesn't work. I've got a simplified piece of Xaml that looks like this: <UserControl x:Class="Foo.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://sc...

How do I bind the Overlay Tool for new Ajax elements in Jquery?

Hi, I'm using: echo $javascript->link('tools.overlay-1.0.4', false); which is initialized with: $(".overlay_popup").overlay({ expose: '#000000', close: '.close_overlay', finish: { top: 'center', left: 'center', absolute: false } }); I call the overlay popup box like this: echo $html->link( ...

How to mimick the behaviour of an ObservableCollection for a List when it is a Source for a CollectionViewSource?

The code below works as follows: a form is shown with a list of sorted names. When the button is clicked a new name is added to the list at the appropriate sorted position from the textbox . When an item of the list is doubleclicked it is prefixed with "AAA", which triggers it to be placed on top of the list. When I change the Observable...

Should custom server control access data or be fully bound from client?

The question is whether it's better to encapsulate general data code within a server control or bind the data to the control from the client? The control will be utilized by various different applications and the data is generally only for the control. So the question is, rather than duplicate the code to bind the control in every clie...

how to bind database to crystal report ?

hi i have C# program, i have DataSet that i want to bind to crystal report. how to do it ? thank's in advance ...

How does [RemoteClass] work in Flex Actionscript can I use it for custom data-binding?

Actionscript supports a [RemoteClass] metadata tag that is used in BlazeDS to provide data-binding hints for marshalling AMF binary objects from Java to BlazeDS. For example: Java: package sample; public class UserInfo { private String userName; public String getUserName() { return userName; } public ...

WPF conditional resource selection

hi all, I want to change back Color (or any other visual properties) on my control based on a boolean statement made from properties in the datacontext of the object . let me explain it with an example : public class Node { public int Min ; public int Max ; } and then I have a wpf control like : <DockPanel x:Name="LayoutRoot...

How do I update an IValueConverter on CollectionChanged?

Here's a basic example to explain my problem. Let's say I have ObservableCollection<int> Numbers {get; set;} and an IValueConverter that returns the sum of Numbers. Normally what I'd do is changed the IValueConverter into an IMultiValueConverter and bind a second value to Numbers.Count like this <MultiBinding Converter="{StaticRes...

Passing the value of a readonly radgrid column to a stored procedure

I have a radgrid bound to a SqlDataSource that includes a hidden, readonly column that stores a pk. I want to pass the value bound to that column to a stored procedure for Updates but the default behavior when the column is readonly is not to pass the parameter to the sqlDataSource. My question is whether there is a way to pass that va...

ASP.NET Repeater and DataBinder.Eval

Hello, I've got a <asp:Repeater> in my webpage, which is bound to a programatically created dataset. The purpose of this repeater is to create an index from A-Z, which, when clicked, refreshes the information on the page. The repeater has a link button like so: <asp:LinkButton ID="indexLetter" Text='<%#DataBinder.Eval(Container.DataIt...

How should data be synchronized between a WinForms GUI control and the client class?

What method is considered the "standard" for keeping data structures within GUI controls synchronized with the data structures that are maintained by the application? For example: In WinForms, if one creates a ListView instance, rather than pointing it to a data structure that represents the items to appear within the list, one must...

Use UIElements as ItemsSource of ListBox in Silverlight

I've noticed that if you have anything deriving from UIElement as items in a ListBox in Silverlight it renders the object as is and isn't paying any attention to settings of DisplayMemberPath and/or ListBox.ItemTemplate. For example if you have XAML like this: <ListBox Width="200" Height="300" DisplayMemberPath="Tag"> <TextBlock Ta...

WPF DataBinding watch for thrown exceptions

Hi All, In my model I have lots of properties for different objects and I'm checking the value while setting value for object and if the value is not accepted I will throw an exception this was working perfect with windows forms propertygrid but now I'm trying to design a new interface using WPF . in WPF when I bound a property to a cont...

Custom WPF Control Dependency Property Not Binding to external DP

I'm trying real hard to make this short and easy to read. I am creating a custom control that has a DP defined (RandomNumber) in the code-behind. The value of this DP is set from a click event fired by a button in my control. Here is the relevant code for this: public partial class Tester { public int RandomNumber { ge...