databinding

How does ASP.Net ensure the correct binding order of internally-bound controls?

If I have something like this: <asp:Repeater DataSource='<%# new List<string>() { 'Tom', 'Dick', 'Harry' } %>' Visible='<%# DataTime.Now.Days == 1 %>' runat="server"> How does .Net determine the order of binding? In that example, it needs to bind twice -- it has to bind the List and the boolean from the expression to a Repeater...whic...

WPF Data Binding

when do i use each of the following? {Binding ElementName=...} {Binding Source=...} {Binding ... Path=...} <TextBox DisplayMemberPath=...} // and i think i saw something like ... {Binding xxx} i also wonder if there are any other ways of data binding i need to be aware of? i am new to C#/WPF ...

Passing a parameter from flex main to a flex(4) component with data binding

I have a main mxml file (flex4) and want to pass a parameter (user_name) to a component in a directory called components. When I run the program, the user_name is NOT being sent from the main to the component file. (Interestingly, if you make the component visible, you can see the parameter has been passed) New to flex/actionscript and...

WPF DependencyProperty and data binding

I am working on WPF project. I create a usercontrol containing a combobox; which represent boolean value(True or false). And I register a DependencyProperty 'Value' for my usercontrol. Whenever combobox selection was changed, I will update the 'Value' property and also when 'Value' property is update I will update combobox. But I found t...

Visual Studio - Change datasource after initial database server is down?

Ok, so I've got this Visual Studio 2008 Project I was working with about a year ago perhaps. And this project had a datagrid that was linked to an external database running on a server off the internet. Now, this databinding was all done using Visual Studio 2008's built in features. But how can I now change the binding to a different se...

Silverlight 4: how to setup properties of the control in custom list

I have a list of object and want to bind for display purposes to a list of custom controls. XAML code: <Pages:MyItemsControl ItemsSource="{Binding SquadFieldPlayers}"> <Pages:MyItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas Height="180" Width...

DualBinding in Flex with Number

Flex 4: I have an issue with dual binding 1067: Implicit Coercion of value of type String to an unrelated type int I have a custom component "Experience": Experience { var years:int; var months:int; } Please help :) ...

Why the content of the pure IEnumerable is invisible for WPF DataGrid?

Let's say I have a datagrid with itemsource binded to property Collection, which is for example IEnumerable. Of course I wrote appropriate getter and setter for it. Now, when I assign to this property (Collection) just IEnumerable (as the result of some method), like: Collection = FooMethod(); // FooMethod returns IEnumerable<MyClass> ...

how to databind datagridview with datatable (C#)

Hi, I want to bind datagridview in windows application with dynamically changed datatable. I have windows form with two textboxes, one for connection string with sql server and the other for sql query string. I just want to display data in datagridview in order to see data. I don't need anything fancy, just to read result of sql query....

Asp.net MVC retrieving a model object from a ViewModel

So I am using ViewModels to pass data from/to the web forms in my MVC application, as seems to be recommended practice from what I have read. My question is what is the normal approach to then map the ViewModel into an actual domain entity? I'm guessing I should probably add a 'GetObject' method to my ViewModels so I have something lik...

How to make Databinding between classes easy?

What would be the best practice to save information for about 30 TextBoxes in a in-memory database such as a dataset. I want it to be easy to modify in case we need to add or remove information parsed. And make sure that it's easy to update this information from my Parser class to the actual Forms or User Controls. I also want to make ...

DataTable type of array binding in cf.net

I would like to make a (very lightweight) 2-way binding datastore. Values must be accessed via names. I was thinking of using 2 arrays: public class MyBindingDatastore{ public string[] _names = new string[]{"Field1", "Field2", "Field3"} public object[] _values = new object[]{ DateTime.Now, "MyValue", 1} } First array is used t...

Is it possible to have WPF/SL4 perform operations on a property binded to another control?

Using SilverLight, one can bind the value of a control to a property from a datacontext. That's fine. It is possible to use StringFormat along with the binding declaration to format the value. Again, that's cool! However, I can't find a way to have the binding with some operation done to it before it gets displayed. I know I can code a...

Domain Maintenance Controls/Forms, is there a Pattern?

Hi, I'm working on an application that has a large domain - i.e. Customers, SalesOrder, Suppliers, Products, Stocks etc. - and have discovered that the WinForms data binding is a little too restrictive for what I need. Is there a useful design pattern for setting up the populating of forms and updating of the underlying data? Thanks ...

PagedCollectionView memory leak Silverlight 4

Hi! I have observable collection with some items. /// <summary> /// The <see cref="Items" /> property's name. /// </summary> public const string ItemsPropertyName = "Items"; private ObservableCollection<SomeItem> _items = new ObservableCollection<BrandItem>(); /// <summary> /// Gets the Items property. ///...

Problem sorting a list inside a databound object.

I have a List<ColumnList> ColumnListLists which has a binding source (bsLists) attached to it. ColumnList has a List<Column> inside of it. I have a binding source attached to the current of bsLists pointing at that inner list. Confused yet? here is some code that may help. public class ColumnList { ... public string Name { ge...

Visibility Binding using DependencyProperty

I've some simple code below that uses a ToggleButton.IsChecked property to set the Visibility of a TextBlock. It works fine. Since this doesn't quite fit in with my program's structure, I'm trying to bind the visibility of another TextBlock to a DependencyProperty of "this". It compiles fine, but it produces no effect. I'm doing some...

How do I allow a ComboBox to have a selected value that is not in ItemsSource?

I have a ComboBox like this: <ComboBox IsEditable="True" ItemsSource="{Binding SelectableValues}" SelectedValue="{Binding SelectedValue}" /> SelectableValues is a list of double and SelectedValue is a double. If the user chooses a value from the list or manually enters one of those values, my SelectedValue propert...

Escaping commas inside a Pack URI data binding (quick question)

Hi, I'm binding an Image control to a value set at runtime, but I want to set the FallbackValue to a resource named "checkerboard.png". As Converters aren't applied to FallbackValues I need to use the Pack notation, which leaves me with the following XAML: <Image x:Name="imgButton" Height="{Binding Path=Height}" Width="{Bindi...

filtering datatable

i have a listview that is bound to a datatable(not using any custom object to represent the fetched data). How do i create a view so that i can filter,sort the collection. (i tried google and the samples i found were using objects(eg:product) to create views) sample code: Private Sub ShowOnlyBargainsFilter(ByVal sender As Object, ByVa...