I have the following DataTemplate:
<DataTemplate DataType="{x:Type Client:WorkItem}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<Co...
I've got my DataContext set to a Book object. Book has properties: Title, Category.
I've got a CollectionViewSource "categoryList" that holds a list of Categories.
Question: How do I select the book's Category in this combobox?
<TextBox Text="{Binding Path=Title}"/>
<ComboBox SelectedValuePath="Id"
SelectedValue="{Binding...
Hi,
When using databindings with OnPropertyChanged as updateDataSourceMode the data source is updated 2 times (OnPropertychanged and OnValidation) :
1- after TextChanged for textbox, CheckedChanged for checkbox, SelectedValueChanged for comboBox...
2- after Validation
I will explain more with an example : assume we have an Employee cla...
How i can set the format of the string returned by Bind ?
<asp:Label ID="lbl" runat="server" Text='<%# Bind("Money") %>'>
thanks
...
Hi,
I have a GridView and i am bind a 4 tables data got with business entities to it .I have declared columns as Template columns .The table contain multiple columns with the same name .How do i bind the correct column in the EditTemplate without using the ItemDataBound ?
Here is what exactly happens Æ
Here the code for the Item templat...
This code give me an Argument out of Range exception. When I remove the binding to the SelectedIndex, the combobox is populated just fine and no exception is thrown.
Any Idea what I am doing wrong? Is this (for some reason) not possible?
public class RuleMap<T> : INotifyPropertyChanged
{
public ObservableCollection<string...
Hi.
So I have a datagridview.
Normally I can create a bindinglist of my object and it will display all the data and colums correctly
E.g
BindingList<Customer> CustomerList = new BindingList<Customer>();
myDataGridView.DataSource = CustomerList;
And it will display a column for each property in Customer which has a getter.
It will a...
Hi
1) I noticed that if we don’t bind GridView to object data source control, then when user puts GridView into edit mode, we have to handle GridView.RowEditing event (else we get an exception ) and in this event put GridView’s row into editing mode. Is there a reason why GridView doesn’t automatically put a row into edit mode?
2)...
I have an Xceed DataGridControl on a WPF Window with a few columns that are data bound to a DataTable. The UpdateSourceTrigger on the grid control is set to CellContentChanged so that the binding source updates as soon as a cell's content changes.
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/prese...
Hi
I’ve read that Keys, OldValues and NewValues collections are automatically populated ( probably when we try to update a row ) only when the GridView control is bound to data by using the DataSourceID property.
So how do you populate those collections when GridView is not bound to data source control?
Thanx
...
Silverlight does not feature DataTriggers, so in this case... what might be the best way to conditionally set the fontweight of an item to a boolean?
For example... the following is not possible in Silverlight.
<TextBlock Text="{Binding Text}">
<TextBlock.Triggers>
<DataTrigger Binding="{Binding IsDefault}" Value="True">
...
I'm trying to control whether or not some <td> elements are rendered or not using databinding and runat="server":
<td runat="server" visible="<%# this.SomeBool %>"><tr>Hello world!</tr></td>
The trouble is that the SomeBool property just isnt being called.
If I explicitly set visible to false, like this:
<td runat="server" visible="...
Given a DataSet instance, is there any way I can find out which controls are bound to it's tables?
I want to stop everything binding to the DataSet, something like :
foreach (Control cont in dataset.ControlsBoundToMe)
{
if (cont is DataGrid)
{
(cont as DataGrid).DataSource = null;
}
}
Thanks
...
Hi,
I'm trying to figure out how data binding with BindingSource is supposed to work
I want a DataGridView to be populated with the content of a List<> upon update of the list.
I can see the List grow and verify it's being filled when I check the debugger. I thought the BindingSource would fire an event when the List is changed. But ...
Hello,
I'm creating a form using WPF with MVVM.
There I have my View with its DataSource bound to my ViewModel object. Great.
In my xaml, I have an ItemsControl with its ItemSource bound to ViewModel.MyCollectionOfFoo.
For every Foo object in this collection, I'm creating a control with bindings to this foo object, but I also need to...
Hi guys, I have 2 comboboxes which we will call cbo1 and cbo2. Now, there is a relationship between cbo1 and cbo2. when i select an item at cbo1, the cbo2 ItemsSource is updated (since it is bound to the SelectedItem) anyway, below is the sample XAML code for it.
<ComboBox x:Name="cbo1" Grid.Row="0" Grid.Column="1" Margin="5" SelectedIt...
I would like to display items from a Queue in a Gridview in Windows Forms. I can set the datasource attribute of the Gridview to the Queue, but it won't be automatically updated. I know I can use the BindingList class, but then I lose my Queue functionality.
Is there any way to combine the two classes, or do I have to implement one of t...
There are a lot of intros to DataBinding out there. But they leave out a lot of the databinding options.
Does anyone know a good reference / instructional document that goes through most/all of the wpf databinding options?
...
I have a template in my section. I want to bind the Width of one of the values in that template to the width of a control in my Main XAML section.
Can this be done? Expression Blend only shows the Template in the Binding list.
For example, this is what I am wanting to have work:
<Windows.Resources>
... My template stuff
<Grid.Co...
Hi
If we have the following code, then when user clicks an Edit button, page is posted back and put into Edit mode:
protected void gvwEmployees_RowEditing(object sender, GridViewEditEventArgs e)
{
gvwEmployees.EditIndex = e.NewEditIndex;
gvwEmployees.DataSource = ds.Tables["Employees"];
gvwEmployees.DataBind();
}
But ...