databinding

Best data binding solution for GWT

Have you ever used one of the many half-baked data binding solutions for GWT? If so, how well did it work? I'd like to stop rolling my own bindings for GWT but there's no clear winner in the data binding space. I'd prefer to use something with a future e.g. GWT Incubator but there's nothing there yet. I use GWTDesigner and love it but...

Does Silverlight support StringFormat in binding?

I know that WPF 3.5 SP1 supports a StringFormat in a binding, but can Silverlight do the same? I thought it could, but damned if I can make it work! Here's a snippet of my XAML: <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding StartTime, StringFormat=t}" /> It compiles OK, but I get a runtime error when it gets to the browser.....

WPF HierarchicalDataTemplate doesn't update ItemsSource on property changed

Here is some XAML <HierarchicalDataTemplate DataType="{x:Type data:FolderEntity}" ItemsSource="{Binding Path=FolderEntities,UpdateSourceTrigger=PropertyChanged}"> <Label Content="{Binding FolderName}"/> </HierarchicalDataTemplate> <TreeView/> data:FolderEntity is a LINQ to SQL data class which implements the INotifyPropertyChangi...

Master/Details view with XmlDataSources

Hi, I have a basic test web form with a DataList and a DetailsView and two XmlDataSource components for each of them. The binding of the DataList to the underlying XML document was easy to set up, but I'm struggling with getting the DetailsView hooked up. The idea is that there is a master/details relationship between the two bindable ...

retaining list selectedIndex between data binding reloads in Flex

In my Flex interface, I've got a few List components that are data bound to ArrayCollections. I'm finding that when the ArrayCollections are updated (by Web services) and the data bindings for the Lists update, each List is reset and its selectedIndex is dropped. This is a problem if a user is in the middle of a task and has already sele...

ASP.NET Datagrid HTML Output (Display)

Currently I am binding a dataset with a datagrid. ds = query.ExecuteReadQuery("select PollQuestionText as 'Survey Question', PollAnswer1Text as 'Selection 1', PollAnswer2Text as 'Selection 2', PollAnswer3Text as 'Selection 3', PollEnabled 'Status' from tbl_pollquestions") For Each row As Data.DataRow In ds.Tables(0).Rows ...

Best practices when applying conditional formatting in data bound controls?

I have a Repeater contol bound to a custom object (an EntitySpaces query) and have noticed there are a couple of ways to conditionally format the values being displayed. 1) From my aspx I can call a method in my code-behind and pass through the bound value and use that to drive any conditional logic: <a class="star" href="<%#M...

How to create HTML output without a) databinding or b) using Response.Write?

Kind of related to my other question - I've only ever used HTMLControls with runat="server" and WebControls grudgingly, preferring to have control over the markup that gets generated (including the ids of the elements, etc.). What's your suggestion for, say, iterating over the contents of a collection and generating a table or list with...

Problem with WPF Data Binding Defined in Code Not Updating UI Elements

I need to define new UI Elements as well as data binding in code because they will be implemented after run-time. Here is a simplified version of what I am trying to do. Data Model: public class AddressBook : INotifyPropertyChanged { private int _houseNumber; public int HouseNumber { get { return _houseNumber; } ...

Databinding ASP.net DropDownList with Entity Framework

I'm trying to bind an ASP.net DropDownList to the results of an entity framework query, while still maintaining multi-tier separation. (i.e. I don't want my UI code to contain query details, nor my Data Layer code to have UI dependencies.) My code-behind in the Page_Load event handler looks like this: IEnumerable<Lookup> Types...

why GetChanges returns something (when bound to a property) even if there are no changes on datatable?

Bound GetChanges always returns something when bound to a usercontrol's property (even on a simple one) i have made a usercontrol, for some reason unknownst to me, when i bound a datacolumn to my control's property the dataSet1.GetChanges() always return something, even the column bound to my control was not changed. what's the possibl...

dropdownlist DataTextField composed from properties?

is there a way to make the datatextfield property of a dropdownlist in asp.net via c# composed of more than one property of an object? public class MyObject { public int Id { get; set; } public string Name { get; set; } public string FunkyValue { get; set; } public int Zip { get; set; } } ...

Binding for WPF Styles

I'm trying to create a custom control - a button - which will have multiple styles applied to it depending on the value of a property within the data context. What I was thinking is using something similar to: <Button Style="{Binding Path=ButtonStyleProperty, Converter={StaticResource styleConverter}}" Text="{Binding Path=TextProp}" />...

TwoWay Manual Binding Implementation for ListBox.SelectedItems?

Hello, I've been trying to see if there is an easy/clever way to implement binding to ListBox.SelectedItems. If you have tried yourself, you will know, that markup binding using BindingExtension will not work - the property doesn't support it. So you are left with wiring up a handler for SelectionChanged and trying that route. The close...

How can I bind to a property on an element that is in is lower in the visual tree?

I don't know if this is the right way to phrase the question or not. Here is a typically databinding example: <UserControl x:Name="root"> <ListView ItemsSource="{Binding MyItemsSource, ElementName=root}" /> </UserControl> But this is what I want to be able to do: <UserControl DataContext="{Binding SelectedItem, ElementName=lstMyI...

What's the simplest way to display NULL values as "NULL" with WPF Data Binding?

I have this legacy database for which I'm building a custom viewer using Linq to Sql. Now some of the fields in a table can have the value NULL. Using normal databinding in a DataTemplate (typed for the Class generated by the ORM Designer) <TextBlock Text="{Binding Path=columnX}"/> If columnX has value NULL, nothing is displayed. (It...

Preferred method for persisting databound WPF ObservableCollection?

Hi all, I have a class that inherits from ObservableCollection(Of MyObject) and the MyObject class handles INotifyPropertyChanged as it should. When the user updates this data through bound controls the collection will change as expected. I have a 'Save' button on the form which is meant to persist this collection to disk as XML by cal...

Winforms Combobox and Databinding

I am databinding a combobox to a DataSet, however I want to insert a single item at the top for "None". Doing: combobox.Items.Insert(0,"None"); Doesn't work, as the combobox is now expecting a DataRowView, however DataRowView doesn't have a public constructor, so I can't fake it that way. Any advice? I'm sure this is a well solved ...

WPF ComboBox Font Binding FileFormatException

I have a WPF Combobox that is binding to Me.fontComboFast.ItemsSource = Fonts.SystemFontFamilies <ComboBox x:Name="fontComboFast"> <ComboBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel /> </ItemsPanelTemplate> </ComboBox.ItemsPanel> <ComboBox.ItemTemplate> <DataTemplate> ...

Binding a ComboBox to an IList and using SelectedValue

I have a ComboBox set up as follows, where KVPList is an IList (of KeyValuePair if it matters): comboBox.DisplayMember = "Value"; comboBox.ValueMember = "Key"; comboBox.DataSource = KVPList; I then have set up a binding with SelectedValue, binding to a BindingSource (to a DataSet). For whatever reason, the combo box always turns up bl...