Trying to accomplish:
I want to change the image property of a bound tree node when the value of an enumerated property changes on the bound object.
Bound Object is representation of an airfield or vehicle base in a game. The object has a property of Type which is an enumerated value type: SmallAirfield, MediumAirField, LargeAirField, ...
I have listbox that displays information about list of objects:
<ListBox Grid.Column="0" Height="152" Name="CustomersList" HorizontalAlignment="Stretch">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name, Mode=OneWay}"/>
<...
Can anyone tell me the pros and cons of using the checkboxes checked property vs the CheckState property for databinding?
Thanks.
...
I have what I think to be an odd problem with listview databinding.
I am calling a protected method on my code-behind called ItemHtml() - as seen below.
<ItemTemplate>
<div class="itemWrapper">
<%# ItemHtml() %>
</div>
</ItemTemplate>
The method is defined as follows.
protected string ItemHtml...
Hello,
I have a TreeView and a couple of other controls like TextBoxs and ComboBoxs.
The textboxes are bound to the selected item in the treeview like this:
Text="{Binding SelectedItem.Name, ElementName=groupTreeView}"
This works fine if all the elements in my treeview have a Name Property.
I was wondering if there was a way to do so...
Hi All,
I am working on a WPF application similar to visio. I would like to be able to logically group some of the items in my diagram, each of which is a UIElement, and control certain behaviors (i.e. visibility) at the group level.
My first attempt at this was to create a control, called a Group, which had width & height = 0. I w...
I have a list of business logic objects that is bound to a Winforms DataGridView, and it contains DateTime fields. By default they get converted into a long date and time string.
I want the fields to be converted automatically into HH:MM format. I've discovered that I can attach a TypeConverterAttribute to a field with a subclass of Typ...
I've been using WinForms databinding to display data from a database mapped with Fluent NHibernate, and that's been working great.
For example, I can just set a DataGridView's DataSource property from an entity's IList property, and voila - there's all the data!
But now I need to start adding and saving new data rows, and that's not g...
I am looking at DataGridView to assist with the following functionality without DataSet/Table usage.
I am replacing few columns with the DataGridViewComboBox. As a specific and slightly contrived example below, I am replacing AccessID column on BindingList (of Setting) :
class Setting
{
public int AccessID { get { return ... } set { ....
I have an asp:DataGrid with templated columns. Here's one of those columns:
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton ID="btnDetails"
Runat="server"
CommandName="details"
Text="Details"
Font-Size="0.8em"
CommandArgument='a=<%# Eval("a")%>&b=<%# Eval("b")%>' />
<...>
When the command fires, the Comma...
Hi All,
I have an objectdatasource which i want to bind to a repeater.
the problem is, I cannot work out how to display a variable amount of columns with a variable amount of rows.
for example:
The dataset I have is structured like this. The objectdatasource is a List<item>.
item {
string name;
List<itemdata> data;
}
itemdata {
...
I'm trying to display a Wpf Treeview with items sorted by a CollectionViewSource.
Currently, everything is working except sorting using this code in my resource dictionary:
<HierarchicalDataTemplate DataType="{x:Type books:Container}" ItemsSource="{Binding Path=Items}">
<nav:ContainerControl />
</HierarchicalDataTemplate>
What wo...
I am trying to use in WPF a validating input of databound controls with validation rules. I have a posintValidationRule class:
public class posintValidationRule : ValidationRule
{
public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
{
string _strInt = value.ToStri...
Hi. I have a databinding like this:
numericUpDown1.DataBindings.Add("Value", myBox1, "Width");
Whenever myBox1.Width changes it will update numericUpDown1.Value.
The problem is when entering new numbers on the control, myBox1.Width will not be updated immediately, but only after the cursor leaves the text area of the control. Is...
I have a set of triggers in a XAML form, and for the life of me I can't figure out why one set works, and the other doesn't, despite being bound to the exact same variable.
First, the triggers that do work:
<StackPanel Orientation="Vertical" Margin="25,0,0,0">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
...
C# (.NET 3.5)
I have an SQLite database with two tables - employees (the first column being id INTEGER PRIMARY KEY), and holidays (id INTEGER - meaning the ID of the employee; start DATE, end DATE - self-explanatory).
My form contains textboxes, checkboxes etc. to represent the employee details - but say I'd also like a list box, listi...
Hopefully this is simple - I DataBind a bunch of labels and text controls in a Silverlight application (to DependencyProperties that I create in my class), but of course the text is empty at design time.
I'd still like to have an idea of how this will be laid out; is there a way to specify a design-time value, even though it's databound...
Here is JSF code:
<o:chart id="categoryLineChart" model="#{categoryReports.categoriesLineChart}"
view="line"
rendered="#{categoryReports.reportRendered}"
height="#{categoryReports.scaleHeight}" width="#{categoryReports.chartWidth}"
binding="#{categoryReports.lineChartComponent}">
<o:chartNoDataMe...
For the life of me I cannot bind the Checked property of a CheckBox control within a TemplateField (declaritively).
I have tried:
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="deactivated" runat="server" checked="<%#Eval("Deactivated")%>"></asp:CheckBox>
</ItemTemplate>
<...
Hello there,
I'm just starting out in WPF and I'm building a simple movie library as a test project to help me find my feet.
I'm storing my movie information in XML, for example:
<movie id="1" title="Back To The Future" date="1985" ... />
The movies appear in a list and when clicked the fields will become editable. I've got that w...