In a simple form, I bind to a number of different objects -- some go in listboxes; some in textblocks.
A couple of these objects have collaborating objects upon which the ToString() method calls when doing its work -- typically a formatter of some kind.
When I step through the code I see that when the databinding is being set up,
To...
I found an example online that explains how to perform databinding to a ListBox control using LINQ in WPF. The example works fine but when I replicate the same code in Silverlight it doesn't work. Is there a fundamental difference between Silverlight and WPF that I'm not aware of?
Here is an Example of the XAML:
<ListBox x:Name="list...
This started with weird behaviour that I thought was tied to my implementation of ToString(), and I asked this question: http://stackoverflow.com/questions/2916068/why-wont-wpf-databindings-show-text-when-tostring-has-a-collaborating-object
It turns out to have nothing to do with collaborators and is reproducible.
When I bind Label.Con...
Argh, although I've been googling, I really would appreciate it if someone could break my problem down as all the code examples online are confusing me more than assisting (perhaps it's just late)...
I have a simple class as defined below:
public class Person
{
int _id;
string _name;
public Person()
{ }
public int...
I am new to Silverlight, and have an issue with binding.
I have a class ItemsManager, that has inside its scope another class Item.
class ItemsManager
{
...
class Item : INotifyPropertyChanged
{
...
private BitmapImage bitmapSource;
public BitmapImage BitmapSource
{
get { return bitmapSource; }
set
{
bitmapSour...
I have the following XAML:
<Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource MyDataKey}}">
<TextBox Name="_myId" Text="{Binding MyDictionary[(Textbox.Name)]}" />
</Grid>
But it thinks the key in my dictionary is called "(Textbox.Name)", instead of "_myId". The format below works, where I have a...
I have a collection of Departments, which has collection of Teachers and which has collection of all the classes they teach. I was able to create a collection of collection of collection from the data source. Now I want to bind the data to datagrid. What I want to bind is the classes taught in the school group by teachers by department.
...
I have two database tables, one for Users of a web site, containing the fields "UserID", "Name" and the foreign key "PageID". And the other with the fields "PageID" (here the primary key), and "Url".
I want to be able to show the data in a gridview with data from both tables, and I'd like to do it with databinding in the aspx page.
I'm...
JFace Databinding doesn't support generics, so it isn't particularly type-safe. And apparently it never will, since they wish to preserve Java 1.3 support.
JGoodies supports generics since 2.0.0. Has anyone ported JGoodies 2 to SWT/JFace? Or is there another library which allows both?
...
I'm using the following syntax to bind to a div element:
<div id="previewdiv"><%=Preview%></div>
Where Preview is a property on my page.
The catch is that I'm creating this in Javascript on a new page in an onclick event. On the server side, I'm able to reference the new page via this property but for some reason when the page is pos...
I'm binding a GridView to a collection of objects that look like this:
public class Transaction
{
public string PersonName { get; set; }
public DateTime TransactionDate { get; set; }
public MoneyCollection TransactedMoney { get; set;}
}
MoneyCollection simply inherits from ObservableCollection<T>, and is a collection of MyMon...
I have a code:
VideoChannel[] channels = GetVideoChannels();
dataGridView1.DataSource = channels;
dataGridView1.Refresh();
VideoChannel is a class with many properties. This code works OK, but I want to change column names. By default, column name = property name of VideoChannel. Is there some attribute that I can mark a property of ...
Hi,
Say I have a list of Employee IDs from one data source and a separate data source with a list of Employees, with their ID, Surname, FirstName, etc.
Is it possible in XAML only to get the Employee's name from the second data source and display it next to the ID, using something like this (with the syntax corrected)?..
<TextBlock x:...
Hi everyone,
Just learning WPF databinding and have a gap in my understanding. I've seen a few similar questions on StackOverflow, but I'm still struggling in determining what I have done wrong.
I have a simple Person class with a Firstname and Surname property (standard CLR properties). I also have a standard CLR property on my Window ...
Hi,
I am trying to implement a mvvm design pattern for xbap application But unable to carry out simple text binding.
Following is the definition of my DemoViewModel.cs,
class DemoViewModel : INotifyPropertyChanged
{
string name;
public event PropertyChangedEventHandler PropertyChanged;
public string Name
{
...
Hi-
I'm trying to use a MultiBinding with a converter where the child elements also have a converter.
The XAML looks like so:
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter="{StaticResource localizedMessageConverter}" ConverterParameter="{x:Static res:Resources.RecordsFound}" >
<Binding Converter="{StaticResource lo...
hi every one
i'm new to Silverlight and it's totally driving me crazy !!
i'm using SL4 and trying to bind datagrid with a Domain Service Query:
what i did exactly is i generate an ado.net entity model from my database,
then create a domain Service class from this model.
then in my page i put Datagrid & button.
in the click event for ...
I want to add search functionality to my program. There's a class which has this function:
public DataTable Search()
{
string SQL = "Select * from Customer where " + mField + " like '%" + mValue + "%'";
DataTable dt = new DataTable();
dt = dm.GetData(SQL);
return (dt);
}...
I'm using the new Routing feature in ASP.NET 4 (Web forms, not MVC). Now I have an asp:ListView which is bound to a datasource. One of the properties is a ClientID which I want to use to link from the ListView items to another page. In global.asax I have defined a route:
System.Web.Routing.RouteTable.Routes.MapPageRoute("ClientRoute",
...
hi all
i have a dropdownlist that bind to a collection of all system colors(ObjectDataProvider).it shows colors name and background of each items is draw with colorName.it works fine . but know i have a listbox that bind to an collection(CollectionViewSource) that
shows a list of element with a property name "backcolor" ,i want to selec...