databinding

Binding to external XML doesn't work, but adding XML using XData makes it work.

Here is the code for App.xaml: <!-- <XmlDataProvider x:Key="BookmarkData" Source="testData.xml" XPath="/Favourites"/>--> <XmlDataProvider x:Key="BookmarkData" XPath="/Favorites"> <x:XData> <Favorites> <Bookmark> <Title>Google</Title> <URL>http://www.google.com&lt;/URL&gt; ...

WPF TreeView with checkboxes.

Hi all! After a lot of searching, I have not found any solution for the following problem. I need a treeview control with "checkboxed" treeview items and the CheckedItems property for convenient data binding (for example, tree view of folders' structure, when user checks folders, the size of checked folders is displayed in a textbox). B...

C# - 2 problems - referencing a cell in DataGridView_RowsAdded causes nullreference error; Cant update database with DataGridView data...

Hey, I just started writing a customer application in C#, using Visual Studio design mode for most of it. Bear in mind I only started learning C# yesterday - so if I am making any stupid mistakes then please say so. What I have so far A database; A DataSet which links to the Customer and Agent tables; A BindingSource which binds to t...

exception handling for databound dropdowns in listviews

One common scenario we run into is with a drop down being databound inside the edit template of a ListView. This usually works pretty well, but I cannot figure out a good way to handle exceptions, for example, look at this error from our website: Server Error in '/' Application. 'ddlLender' has a SelectedValue which is invalid because...

What Linq to XML do I need to bind XML to Silverlight Datagrid

I was looking at this question and it gave me about 80% of what I needed. The "problem" for me is that my XML is strucutred differently and I am not quite sure how I would go about using Linq to get at what I need. My XML looks like this (By the way, its generated by the ConvertTo-XMl PowerShell Cmdlet) <?xml version="1.0"?> <Objects> ...

What's wrong with this code?

public partial class Form1 : Form { MyClass myClass = new MyClass("one", "two"); public Form1() { InitializeComponent(); textBox1.DataBindings.Add("Text", myClass, "Text1", false, DataSourceUpdateMode.Never); textBox2.DataBindings.Add("Text", myClass, "Text2", false, DataSourceUpdateMode.Never); }...

Should WP7 edit forms have Save/Cancel buttons or should you use 2 way binding?

This is a question on edit form UI for a WP7 app: I currently have my edit form fields set to 2-way binding which means that as the user changes them they save on edit and update the UI in the ViewModel (Method 1). So I don't need a Save button and there is no Cancel button (unless you code in logic to store the original state and roll...

IValueConverter not working in blend design

I am using Blend 4. I am having a list item which i am binding to sample dataset VM using this approach, which works fine. The issue is with the IValueConverter applied to binding. Blend doesn't seem to process the converter in design time UI. Is it possible for Blend to process data using converters in design time? ...

In WPF how to get binding of a specific item from the code?

The example of this would be: A textBox is bound to some data. There is a second text box which is not bind to anything. So I want to bind text box 2 to the same data 1st textBox is bound. In other words I wan't to know if the DependencyObject stores some reference to it's data-bindings? If not, what is the way to find out all data-bin...

XML databinding to TreeView with child nodes of different types under the same parent

Note: See the bottom of this post for the solution. I'm trying to use XAML's "HierarchicalDataTemplate" to display an xml document in a TreeView. My current XAML code will display the first child of the "Parent" node but not subsequent child nodes of different types. Can I use XAML to display children of different types under a common...

ListBox.ItemsSource {Binding ...} doesn't work, but if I set the ItemsSource in code, it's all dandy!

Hello, I am experimenting with WPF and I came across a problem I can't seem to figure out although I have done some work with Silverlight previously and used DataContexts, Data Bindings and INPC successfully. This time I am stuck... I am using this code to create an instance of the application's main window: protected override void OnS...

Master Detail SPDataSource

if i have a Repeater bound to a SPDataSource and within the repeaters template another Repeater and SPDataSource. How do I pass a parameter from the outer SPDataSource to the inner? <div class="menu-container"> <sharepoint:spdatasource id="SPDataSourceCategories" runat="server" datasourcemode="List" useinternalname="true" ...

what are the fastest java tools to generate CRUD screens from a DB schema?

I am constantly in search of better and faster java tools to prototype webapps. I generally start with a good data model on the backend, and work towards the screens. What are some good tools that I might not know about that can be used to quickly generate functioning CRUD screens. ...

How to create Master Detail view with two user controls in MVVM?

I am little confused about how to create Master Detail view with two different user controls. There are three choices, Choice 1 CustomerMasterView + CustomerMasterViewModel CustomerDetailView + CustomerDetailViewModel And keep both View Models in App.Resources But by doing this, binding becomes complex with all static resources sou...

silverlight treeview

Using WCF i get data from server. Data contains Folders and these folders contain queries. I need to set folder icon(expanded collapsed) on the folder node and another icon on query. TreeView is bound to this collection using HierarchicalDataTemplate. I tryed to do it with converter but failed. I also want it to be MVVM compliant. <sdk:...

Using silverlight datepicker and timepicker together

I'm using the Silverlight DatePicker and TimePicker from the toolkit together to allow a user to select a date and time. They are bound to the same DateTime value on a business object behind the scences. This mostly works okay, except when the date component is changed the time component is wiped. This is kinda logical but probably not t...

display sql resultset to grid or table

I need to know how to display the result of a select query in a datagrid or GridView with VB.NET? Consider SELECT * FROM some_table. I don't know what columns the table has. Is there a way to just output the result to a table, with a dataset for example? How can this be done easily? ...

First item in databound ListView occasionally being duplicated?

I have a WPF (.Net 4) ListView used to navigate a local Windows directory. It displays the contents of the current directory, with name and size and all that. However, in some directories, the first element it displays shows up twice. For example, let's say in directory "D1" I have subdirectories "W", "X", "Y", and "Z". The ListView will...

WPF: Bindings not working correctly

Say I have XAML like <TabControl Grid.Row="1" Grid.Column="2" ItemsSource="{Binding Tabs}" IsSynchronizedWithCurrentItem="True"> <TabControl.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding TabTitle}" /> </DataTemplate> </TabControl.ItemTemplate> <TabControl.ContentTemplate> <DataTem...

WPF semi cascading listbox

I have 3 controls on my page ListBox A ListBox B ComboBox C ListBox A is databound to a collection of items A ComboBox C is databound to a collection of items C ListBox B is databound to a collection of items B B has a reference to Item A and Item C, the ListBox B should only show the items where Item A is the selected item of Li...