databinding

How do I update a listview item that is bound to a collection in WPF?

In WPF, I have a ListView bound to an ObservableCollection in the code-behind. I have working code that adds and removes items from the list by updating the collection. I have an 'Edit' button which opens a dialog and allows the user to edit the values for the selected ListView item. However, when I change the item, the list view is...

WPF ListView ItemTemplate questions

Let's say that I've got the following class hierarchy : public static class Constants { public enum MyEnum { Value1 =0, Value2, Value3 } } public class Data : INotifyPropertyChanged { public Data(string name, ushort id, Constants.MyEnum e) { DataName = name; DataId = id; ...

Gridview DataSourceID with Multiple Datasources?

I would like to display clickable news headlines. But I'm having trouble pulling data from two datasources for a single GridView. I'm trying to do this DataSourceID="SqlDataSource1, SqlDataSource2" but that's not working. Thanks in advance. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" ...

Binding of TextBlock inside Custom Control to dependency property of the same Custom Control

I have a custom control with a TextBlock inside it: <Style TargetType="{x:Type local:CustControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:CustControl}"> <Border Background="Blue" Height="26" Width="26...

Data binding custom control with parent

I have a UserControl that contains a listbox. On the parent window, I have this UserControl and a button. Ideally I'd like to use the ChangePropertyAction behavior on the parents button, and tie it to the UserControl's listbox count. The idea being that if there are no entries in the listbox inside the usercontrol, the button on th...

Binding a DropDownList in an editable GridView

I thought I'd save myself some time by throwing down a GridView in an admin tool I was working on. This particular page is for editing Categories that “widgets” can then be assigned to. For organizational purposes, categories can (optionally) also be grouped (assigned to a CategoryGroup). There were already existing business logic and ob...

Is there a good examples and documentation of jface databinding framework for Eclipse 3.4?

The official site is quite scarce and most of the examples are EMF- related and for Eclipse 3.5 But what if one uses 3.4 target Eclipse platform and does not use EMF. I am specifically interested in Tree Viewer examples, but good example and documentation is always appreciated. ...

is it possiable to use conditional operator in combo box dataprovider using flex?

In my Combo box i have to shows team names condition based . So i will try like dataProvider="{usersXML.users.user.(id=10).name}" but shows some errors . but if i tried dataProvider="{usersXML.users.user.name}" display all name . It's working . How can i condition based to display the list . In combobox . Plz refer me . is it possiab...

How to make ContentControl listen to non-routed event inside its ContentTemplate

I have some reusable ContentControl, which acts as a pseudo-modal popup inside another view. It is always there and only its visibility makes it appear or disappear. When instantiated, within the ContentControl there will be a custom ContentTemplate, bound to some ViewModel and representing the content of the "modal popup". <Dialogs:Mod...

Bind a multi-dimensional ArrayList to a Gridview

I have a DataGrid of seats available, each with a checkbox to be able to reserve the seat. In the button click event, if the CheckBox is clicked, I am adding the contents of the row to an ArrayList, then adding the ArrayList to a session before redirecting to the confirmation page: protected void Reserve_Click(object sender, EventArgs e...

WPF - Workaround for ValidationRule not being a DependencyObject

What is the best solution for not being able to use data binding on a ValidationRule property since ValiationRule is not a DependencyObject? Below is an example of what I would like to do. I want to be able to validate the text in the TextBox against some other DependencyProperty. <TextBox Name="myTextBox"> <TextBox.Text> <...

Bound gridview problem; jquery resolution in unbind?

Good evening all. I have a bit of a puzzler for you. On my page I have a cascading ddl (ddlBuyer), a textbox search (tbxProdAC) and a radio button list (radTopx). These, once populated, and a submit button clicked, produces a gridview populated with data. What I am trying to achieve is that the user can only select either the ddl, the ...

How is empty string collection any different from other empty collections, which don’t cause an exception

Hi If ObjectDataSource.SelectMethod = A and if A() returns a single object of type O, then this object is wrapped in a one element IEnumerable collection and returned by the ODS.Select method Thus, assuming ODS.SelectMethod points to method A(), then if A() returns a null , when called by ODS, this null is ( I assume ) wrapped into ...

WPF - How to set DataContext on virtual branch of logical tree?

How do I set the DataContext of "myElement" to the same DataContext as the user control in XAML? I have been able to do it in code-behind via myElement.DataContext = this.DataContext in the UserControl constructor, but I'm trying to understand how to do the same thing in XAML. This is related to creating virtual branches to the logical ...

WPF - Why isn't ValidationRule a DependencyObject?

Is there a technical reason why ValidationRule is not a DependencyObject? ...

ObservableCollection wrapper to cast to a base type.

I have a class called Client, which is a subclass of Configurable. I have an ObservableCollection<Client> which I need to view as an ObservableCollection<Configurable>. This will allow me to databind to the list from some general layout generation code. It must also allow me to clear the list, and to add items to the list. Of course...

CSharp .NET 3.5 Windows Form DataBinding ComboBox to a List<>

Hi there, Ok, firstly I have the following code working.. although my question is this; should I code the combobox databinding like the following example, or is there an easier/more efficient way? Firstly, I needed to manipulate the results back from the database to show a more descriptive meaning: (I am using a basic class for the ke...

ASP.NET MVC Two Way Data Binding of Model to Radio Button List using Typed Model.

I have a mvc view made up of a matrix of radio buttons. Each row of radio buttons is in a group and represents a typed object from the model. Using the guidance of various blogs and postings I have successfully bound the posted form results to the typed model array in the controller action, however cannot seem to successfully reverse t...

Inserting a new object into L2S table and databinding to it prior to SubmitChanges() in WPF

Hi, I'm just getting started with Linq-to-SQL and data binding in WPF, most of which works like a dream so far! I've got (what I though was) a common scenario: a) Query list of records from a table via datacontext and bind to the current user control this.DataContext = db.ClientTypes; b) Have the user see a bound ListView and some ...

How do you know to use Container.DataItem when data binding in ASP.NET? Is there a reference?

Is there a reference for data binding? I've seen a bunch of different ways to data bind things, but I've never found a reference. Is there one? I know there are Bind and Eval, but when does Container.DataItem come into play? Are there other "hidden" objects and methods available? Or is Container.DataItem the object that is being use...