databinding

How to bind controls to the DataGridView

I'm new to .NET, so please be patient with me ;) On my Windows Form, I have a DataGridView that is bound to a data source. Since my grid is read-only, I have a set of controls (textbox, checkbox, etc.) outside the grid that will be used to edit the data. I want the controls to be binded to the currently selected row in the grid. Curren...

Updating a Database from DataBound Controls

Hi. I'm currently creating a WinForm in VB.NET bound to an access database. Basically what i have are two forms: one is a search form used to search the database, and the other is a details form. You run a search on the searchForm and it returns a list of Primary Keys and a few other identifying values. You then double click on the entr...

Swing Matisse GUI - cannot add custom made bean to "Other components"

I made a custom ValueObject class with properties (getters/setters) and I need this class for data binding of elements on form. So I want to drag it to "other components" on matisse editor so I can bind it - and nothing happens.... Any similar experiences? The same issue is happening both on NetBeans 6.5 and MyEclipse 7.0M2 ...

Binding a DynamicResource

I'm trying to use a MultiBinding as the ItemsSource for a ListBox, and I want to bind a couple of collections to the MultiBinding. The collections aren't populated until after the host control (a derivation of Page) has already been instantiated. Just after being constructed, I call a method that sets up some of the data for the Page, ...

Exposing Multiple Databinding sources

I feel like I'm missing a fairly fundamental concept to WPF when it comes to databinding, but I can't seem to find the right combination of Google keywords to locate what I'm after, so maybe the SO Community can help. :) I've got a WPF usercontrol that needs to databind to two separate objects in order to display properly. Both objects ...

databind the Source property of the WebBrowser in WPF

Does anyone know how to databind the .Source property of the WebBrowser in WPF ( 3.5SP1 )? I have a listview that I want to have a small WebBrowser on the left, and content on the right, and to databind the source of each WebBrowser with the URI in each object bound to the list item. This is what I have as a proof of concept so far, but...

SQL 2 LINQ query (called by databinding) completely freezing WPF application

Earlier today I was hunting down a very weird bug... I finally traced it down to what seems to be causing the problem. The original report can be found here: original question The details have changed enough to warrant a new question. It would seem my application sometimes, NOT ALL OF THE TIME, freezes when it reaches the following LI...

Best practice when not implementing IValueConvert.ConvertBack

Just wondering what people think is the best practice when implementing an IValueConverter which does not have a meaningfull ConvertBack implementation (or one that is only to be used as OneWay)? Should it throw (and in that case what exception), return null or return some default value. Thoughts? ...

How do you bind data to multiple columns in a list view?

I have a datasource that I want to bind to a listview that has multiple columns. How do I bind my datasource to that listview Here is some pseudo code that doesn't work to help illustrate what I am trying to do: MyDataTable dt = GetDataSource(); ListView1.DataBindings.Add("Column1.Text", dt, "MyDBCol1"); ListView1.DataBindings.Add("Col...

How to use a custom item template containing Path tag in ComboBox (without causing out of range exception)

I have a combo box with the following DataTemplate: <DataTemplate x:Key="ComboBoxDataTemplate"> <StackPanel> <TextBlock Text="{Binding Path='Name'}"/> <Path Data="{Binding Path='PathGeometry'}" Width="64" Height="64" Stroke="Black" Stretch="Fill" StrokeThickness="1"/> </StackPanel>...

Problems migrating databinding in VB.NET from Winforms to ASP.NET 2.0

And this was supposed to be so easy... I have existing business and data access layers that handle the retrieval and update of the data in question. These work great with the existing Winforms application (.Net V2.0) Now, in trying to write a new web-based UI, I'm running into all sorts of problems (last time I wrote asp.net code was ...

C# Binding: How can I disable the CurrencyManager in BindingList so Current Item position is not maintained and not signaled?

Hi, I've got two ListBox'es that are databound to the same BindingList. The issue is that when changing the selected item from the GUI it's changing the position in the BindingList and then the BindingList signals the other ListBox to change its selected item. So I've got the two ListBoxes Selected Item also synchronized which is not ...

How to properly set a datatable to an gridview in code with an ObjectDataSource?

Hello, I have an ObjectDataSource with an ID of ObjectDataSource1 on a webpage. I also have a gridview in which I am binding the ObjectDataSource.ID to the GridView.DataSourceID. The problem I get is when text is changed in a textbox, the code calls BrokerageTransactions.GetAllWithDt which returns a DataTable. I want to set this data...

How do I use a WPF TreeView HierarchicalDataTemplate with LINQ to Entities?

I've got a Page class in my .edmx ADO.NET Entity Data Model file with with Parent and Children properties. It's for a hierarchy of Pages. This is handled in my SQL database with a ParentId foreign key in the Page table bound to the Id primary key of that same Page table. How do I display this hierarchy in a WPF TreeView? ...

<%# Eval("State") %> or <%# DataBinder.Eval(Container.DataItem, "state")%>

What is the difference between having <%# Eval("State") %> in your aspx page or <%# DataBinder.Eval(Container.DataItem,"state") %> in your aspx page? Thanks, X ...

Cannot cast DataItem to DataRowView in Custom Binding Scenario

I have an object that returns an IList which I'm getting from my ObjectDataSource and binding to a Gridview. All works fine if I just use standard binding, but I'm trying to customize my binding to set properties on a linkbutton as follows: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { ...

WPF TreeView Binding

I've got a class with Parent and Children properties. I want to display this hierarchy in a WPF treeview. Here's my XAML... <TreeView Margin="12" Name="TreeViewPages" ItemsSource="{Binding}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Children}"> <TextBlock Text="{Binding Path=Sho...

WPF TreeView Binding

I've got a class with Parent and Children properties. I want to display this hierarchy in a WPF treeview. Here's my XAML... <TreeView Margin="12" Name="TreeViewPages" ItemsSource="{Binding}"> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type Page}" ItemsSource="{Binding Children}"> <TextBlock T...

Binding one collection to multiple tabs with filters

In my small WPF project, I have a TabControl with three tabs. On each tab is a ListBox. This project keeps track of groceries we need to buy. (No, it's not homework, it's for my wife.) So I have a list of ShoppingListItems, each of which has a Name and a Needed property: true when we need the item, and false after we buy it. So the ...

How can I databind to properties not associated with a list item in classes deriving List<T>

Previously, I had a class that wrapped an internal System.Collections.Generic.List<Item> (where Item is a class I created). The wrapper class provided several collection-level properties that provided totals, averages, and other computations on items in the list. I was creating a BindingSource around this wrapped List<> and another Bin...