I have TextBox controls on a WinForm bound to a BindingSource. If I set CausesValidation = false on these controls it doesn't update data source on tableAdapter.Update() method. I know that Control.Validating event does this saving but how can I update source if CausesValidation is disabled?
...
When databinding my xaml to some data I often use the "get" part of a property to do some logic. Like giving to sum of totals of a list or a check if something is positive.
For example:
public List<SomeClass> ListOfSomeClass{get;set;}
public double SumOfSomeClass
{
get
{
return ListOfSomeClass.Sum(s => s.Totals);
}
}
public...
I'm following a video tutorial on data binding with Visual Studio / Expression Blend.
In the tutorial the application's custom objects are listed when the presenter clicks on the "+CLR Object" button, but in when I do it, my application's objects are not listed.
What do I need to do to get my application's objects to be listed here?
...
Hi all,
OK,... so I have a number of tables in my DB that hold references to an key value pair:
types of phone numbers:
1 - Home
2 - Work
3 - Mobile
4 - Fax
etc
So I have a table for the types and when they are used in other tables they reference the int value as a foreign key. When I have been pulling them out I have been storing...
How do you bind to an objects method in this scenario in WPF?
public class RootObject
{
public string Name { get; }
public ObservableCollection<ChildObject> GetChildren() {...}
}
public class ChildObject
{
public string Name { get; }
}
XAML:
<TreeView ItemsSource="some list of RootObjects">
<TreeView.Resources>
...
I'm trying to build a data grid where one of the columns is a font name displayed in that font. Previously, I was working with a list box where I had defined the following template:
<TextBlock Text="{Binding Path=Name}" FontFamily="{Binding Path=Name}"/>
This worked just fine. So, I tweaked the data structure (Name became Font.Name) a...
We have an app that uses simple one way binding with a GridView to display some data. Well, now we need to allow the user to change some of that data, so I've been trying to get two way data binding to work in the GridView. So far everything displays correctly, but editing cells in the GridView seems to do nothing at all. What am I messi...
I have been binding textboxes in a winform with C# to a dataset. Whenever the data doesn't validate with what the database except it silently forces the focus to remain on the textbox. How can I catch the validation error and tell the user about it (and free the focus)? The BindingSource event OnDataError isn't fired.
...
I have a listbox and I want to iterate over a collection of Bars in my Foo-object.
<ListBox DataContext="{Binding Path=Foo.Bars}" >
<ListBox.Items>
<ListBoxItem>
<ContentControl DataContext="{Binding Path=.}" />
</ListBoxItem>
</ListBox.Items>
</ListBox>
This is the datatemplate I want to use.
<Dat...
Hi, is there any way to bring up a subheader row at changes in a field in an databound asp:repeater control e.g.
Instead of
country | colour | number
uk | red | 3
uk | green | 3
france | red 3
Do this:
==UK==
colour | number
red | 3
green 3
==FRANCE==
colour | number
red | 3
Many thanks for any help.
...
If I create a user control (EDIT:not a web control/server control) it's pretty trivial to get databinding. I just add a datasourceID property.
In code behind (vb)
Partial Public Class BandedControl
Inherits UserControl
Public Property DataSourceID() As String
Get
Return MyGridView.DataSourceID
End ...
I have a DataTamplate for my ItemsControl that merely contains an Image with some other meta data. What I am trying to do is bind to the ItemsControl and have the Images be displayed with the Convas.Left and Canvas.Top that is bound via the data I give.
I have been trying my best to remove any Panels from the control via the ItemsPanel...
WinForms has great databinding support, and the ErrorProvider makes it quiet easy to display business object errors.
However, the conversion errors seems to be swallowed. If I type 'aaa' into a TextBox databound to an integer property, I get nothing from the ErrorProvider. So in this case my UI tells me everything is fine, when 'aaa' is...
Hi,
Does anybody knows, if there is a way to use a property that is animated as source for a binding?
As far as I found out, is that an animation doesn't "really" set the value on the property, and therefore doesn't fire the changed events, which is needed to trigger the binding.
tia
Martin
...
I'm starting to understand XAML data binding and using the DataTemplate and it's pretty nice.
What is the best way to take the next step and put logic into the code below,
e.g. look to see if there is anything in "Address2" and if so display it,
or format foreign addresses differently, etc.?
<Window.Resources>
<DataTemplate x:Key...
I have a GridView bound to an ObjectDataSource. I've got it supporting editing as well, which works just fine. However, I'd like to safely HtmlEncode text that is displayed as we do allow special characters in certain fields. This is a cinch to do with standard BoundFields, as I just set HtmlEncode to true.
But in order to setup vali...
I have a textbox bound to a currency data field. So it adds '$' to the start of the text or ($xx.xx) if it's negative. How do I get just the plain double (xx.xx) from the textbox instead of everything ($xx.xx)?
...
I have a data-source connected to a stored proc that will return the one record that applies to a specific page, and for another similar situation (populating heading information), I wrapped a repeater around the headings html, and used <%$ Eval() %> binding expressions to get the data into the headings. However, I now have another issue...
Hi,
in a WPF project with Linq to SQL, if you use the O/R - designer to create a simple structure with 3 that are all tied with forgin key relataions like so:
Customer <-- Orders <-- Items, and say i want a simpe window with 3 syncronized comboboxes
when you select a customer you see only his orders and when you select an Order you see...
Hello,
Let's say I have the following command object:
class BreakfastSelectCommand{
List<Breakfast> possibleBreakfasts;
Breakfast selectedBreakfast;
}
How can I have spring populate "selectedBreakfast" with a breakfast from the list?
I was figuring I'd do something like this in my jsp:
<form:radiobuttons items="${possibleBreakfas...