I've created two UserControls, the first of which displays a list of objects, the second of which displays details about an object that is selected from the first. I've created a dependency property on the first control and am binding each UserControl to an object declared in my Resources collection. I've seen blog posts describing this,...
I have a parent object of type Parent and it currently has a null property called Foo of type Child and that Child class has a property of type string called Name.
If the user types into a Text Box for that Name property then I want to automatically create an instance of Child and set it as the Foo property of Parent before finally sett...
Hi. I'm trying to make a simple crossword puzzle game in Silverlight 2.0. I'm working on a UserControl-ish component that represents a square in the puzzle. I'm having trouble with binding up my UserControl's properties with its' elements. I've finally (sort of) got it working (may be helpful to some - it took me a few long hours), but w...
I use binding in a win-forms application (.Net 2.0), and I try to find the best way to maintain the selected items in my data bound controls. I read that the best way to access the selection is by using CurrencyManager's (or bindingSource's) "Current" and "Position" properties. The problem is that I can't find a way to select nothing (Po...
WinForms, .NetFramework 3.5
Are there any known issues when databinding to a control's visible property?
The control is always NOT visible regardless of what my property is.
Public ReadOnly Property IsRibbonCategory() As Boolean
Get
Return True
End Get
End Property
I tried the control's text property and other properti...
I'm trying to get the code example from here to work but using a ToolStripMenuItem instead of a ToolStripLabel. However, When I do the following
toolStripMenuItemInstance.DataBindings.Add("Checked", SingletonInstance, "Enabled")
(where Enabled is a boolean property of the SingletonInstance)
nothing happens. Checking the toolStripMenu...
I'm using Visual Studio 2005, C# with Framework 2.0. I'd like to use auto complete, but would like the list to come from a table in my database.
Is there a way to databind the AutoCompleteSoure?
...
Solution
This is what I came up with:
Public Class IndexedDropDownItem
Private _KeyCode, _Display As String
Public Property KeyCode() As String
Get
Return _KeyCode
End Get
Set(ByVal value As String)
_KeyCode = value
End Set
End Property
Public Property Display() As...
Hopefully I phrased the question correctly. If not, let me explain. I want to bind an Image element's Source property to a the ImageUrl property of my DataContext object. Here is the XAML:
<Image
x:Name="EmployeeImage"
Grid.Column="0"
Grid.Row="0"
Grid.RowSpan="2"
Source="{Binding Path=ImageUrl}"
Stretch="Uniform...
I'm getting the following error every time my Silverlight application load and cannot figure out how to get around it. This error occurs right when the UserControl is loaded (but before the Source is bound). I've tried handling this error during the ImageFailed event, but it is not fired when this exception is thrown. What can I do?
<Im...
Many of you may have noticed that since RC1 you don't have to include the .Index hidden field to enable complex model binding. However one of the drawbacks is that now you have to have the index starting from 0 and it cannot break. eg. skip from 4 to 6 etc.
With the old syntax I was able to just remove the item from the DOM and when th...
I have a GridView that is bound to a LINQDataSource control that is returning a collection of customers.
Within my DataGrid I need to display the home phone number of a customer, if they have one. The phone numbers of a customer are stored in a separate table with a foreign key pointing to the customer table.
The following binding exp...
I have an existing application that uses Active Record for its data retrieval. It's in VB.NET (first time I'm doing VB.NET; I usually work in C#). And I'm building a method to return a List(Of T) of an object.
The current pattern uses a SQLDataAdapter to populate a datatable. I COULD add the record to the List(Of T) as I fill the datat...
Hello
using Bind in a GridView control template enables the control to extract values from child controls in the template and pass them to the data source control. The data source control in turn performs the appropriate command for the database. For this reason, the Bind function is used inside the EditItemTemplate or InsertItemTem...
Is it possible to use a LINQ extension method within an ASP.NET databinding expression?
Within a GridView that is bound to a Customer collection which in-turn has a related Phones collection the following Eval expression fails:
<%# Eval("Phones.Single(p => p.PhoneTypeId == 2)") %>
The error message I receive is: 'First(p => p' is not...
I have a ObservableCollection that's bound to a ListBox in WPF. I want the ListBox to be editable, and for the editing changes to be saved to the collection. Since WPF doesnt provide an editable listbox, I've tried creating my own by changing the ListBox.ItemTemplate.
<ListBox.ItemTemplate>
<DataTemplate>
<TextBox Name="E...
I am currently stuck at a dead end with the following situation:
I have a List<Category> collection with each Category containing an Id, Name and a List<string[]> property called Subcategory (where array contains the Name and Id of that subcagtegory - I didn't feel like creating another class).
I have a TreeView with HierarchicalDataTe...
I have a form that will be populated by a bunch of information from a template, and then handed over to the user to fill out the rest. The thing is, the template and the object that holds the eventual result are DataRows, because it's all going into and out of a database (that I have no schema control over), so this seems like a great pl...
I'm trying to find a way to to do something that I think must be possible but I'm just missing the point on - so hopefully someone can give me a bit of a nudge :)
I'm utilising databinding in ASP.NET (viewstate turned off - so using controlstate for a few things here and there) to render a repeater (repeaterPriceClasses) that has a repe...
I'm having a brain cramp trying to understand the appropriate way to use JGoodies bindings in my application.
I have a class Article which is a bean that has read-only properties. Article is a "plain" bean, and doesn't manage property listeners, since the properties don't ever change. I have a Swing JPanel which I would like to use to d...