Hi,
How to create dynamic checkboxes at run time from the databases values using MVVM pattern. I have set all the table columns as get;set; properties in Model. But not getting how to create the checkboxes using MVVM and where to put what means where to put database connections and functions for that and how to bind the dynamically crea...
I have a collection of objects stored in a CollectionViewSource and bound to a DataGrid. I want to display a 'detail view' of the object currently selected in the DataGrid. I can obtain the current object using CollectionViewSource.View.CurrentItem.
MyClass{
[IsImportant]
AProperty{}
AnotherProperty{}
[IsImportant]
...
I bind to a ItemsControl in my codebehind:
ColumnVisibilityItems.DataContext = gc.ColumnVisibility;
where ColumnVisibility is a ObservableCollection, also tried it with dictionary..
my markup
<ItemsControl x:Name="ColumnVisibilityItems">
<Label Content="{Binding Path=Name}" />
</I...
I created class:
class StorageBase
{
public Queue<Slices> Slices {get;set;}
}
and wpf custom control which has dependency property Storage of type StorageBase:
public StorageBase Storage
{
get { return (StorageBase)GetValue(StorageProperty); }
set { SetValue(StorageProperty, value); }
}
...
I would like to create a C# WPF form that collects measurements of equipment, but some users insit on using feet and inches for measurements while other (younger) users do everything in metric. The database stores everything in meters, and I figured this was a perfect place to use a IMultiValueConverter.
Each form has a DependencyProper...
I have tried to set up combo boxes in the gridview but all the combo boxes have the same value in them instead of the value from the database. I am using entity framework and WPF. There is a parent child relationship between two tables but the source for the combo box is a separate table with names and IDs for tags. I have been looking a...
I'm dynamically creating multiple expandable panel in silverlight. Every panel contains textbox. I need to bind this textbox to parent expandable panel header property.
How to do it dynamically?
...
I'm new to DataBinding but would like to accomplish the following:
I have a ViewModel which has a collection of objects: CollectionOfStuff
Each object Stuff has some properties: Name, Value.
In my View, I have a StackPanel with some TextBlocks. I would like to bind the TextBlock's Text property to a specific property. ( I would like t...
Hello
Ok, I have a specific custom behavior for my MenuItems. So I bind the windows from my static class FormsResource and it works perfectly. But, very often, I get an exception "Exception has been thrown by the target of an invocation" in the 3 lines where I have "{Binding Source={x:Static local:foo}}" I can't see the inner exception, ...
I have a custom ItemsControl (WorKArea) that marks all items it has into a WorkSheet instance.
I have a style for the ItemsControl that uses a TabControl to show the content. Every sheet creates a tab. The style is:
<Style TargetType="{x:Type local:WorkArea}">
<Setter Property="Template">
<Setter.Value>
<Control...
I have an ItemsControl that displays a bunch rectangles. Each rectangle needs to be offset upward and to the left. So, I created a RectangleStyle that uses bindings to set the width, height, X translation, and Y translation for a rectangle.
The width and height bindings are working fine, but I'm getting the following error for the Tran...
Hello,
I'm trying to use WPFToolkit's DataGrid control (and C#/.Net 3.5) to display a ComboBox per record. With the below code, the ComboBoxes show up but their drop-downs contain no items:
<wpftkit:DataGrid ItemsSource="{Binding TransactionToEdit.SisterTransactions}"
AutoGenerateColumns="False">
<wpftkit:DataGrid.Columns>
...
I have a user control in WPF which i want the text of one of it's labels to be read from the XAML where it is used. Hence..
My User Control:
<UserControl x:Class="muc">
<Label Foreground="#FF7800" FontSize="20" FontWeight="Bold">
<Label.Content>
<Binding ElementName="TestName" Path="." />...
This is driving me nuts. I have a datagrid in WPF that is not populating with records at runtime.
Here is the XAML. I've done this before in Silverlight although I am a newbie and can't quite figure out what is missing.
<DataGrid AutoGenerateColumns="True" Height="335" HorizontalAlignment="Left" Name="DataGrid1" VerticalAlignment="To...
I know I did this in Silverlight...
In WPF 4 I am trying to put controls in a DataGridTemplateColumn element in DataGrid XAML
I can't add anything to it and I get errors saying it doesn't support direct content. WTF?
I want to put in maybe a hyperlink, textboxes, a button, etc. I can't even add a canvas.
...
I'm building a simple ControlTemplate for a Button. I want to draw a 2 color gradient, and bind the two colors so I don't need to hard code them in the template. But since Background and Foreground are Brushes and not just Colors, I'm not sure this will work.
Can anyone tell me if there is a good way to do this? it seems simple enoug...
in my browser wpf application i use databinding to xml that comes from my database.
to bind it the better way i use the XmlDataProvider.
in the beginning i declare
<Grid.DataContext>
<XmlDataProvider x:Name="listdataxml" XPath="EssenceList/Essence" Source="model.xml"/>
</Grid.DataContext>
but later i need to point it to a new XDo...
My XAML is as follows
<Button.IsEnabled >
<MultiBinding Converter="{StaticResource IsEnabledConverter}" >
<Binding Path="aaa"/>
<Binding Path="bbb"/>
<Binding Path="ccc"/>
<Binding Path="ddd"/>
<Binding Path="eee"/>
<Binding Path="fff"/>
<Binding Path="ggg"/>
<Binding P...
In WPF-XAML, determining DataContext at designtime vs runtime.
Why do we have to add "d:DataContext" while we already have set the "DataContext" ?
Why Microsoft introduced DesignTime attributes (code that we have to add, a little bit complex) when it could already be determined automatically by itself using "DataContext" attribute. The ...
HI,
I stuggeling with the databinding with in a custom control
I've got some properties within my custom control.
public static DependencyProperty TitleProperty;
public static DependencyProperty PageDictionaryProperty;
public string Title
{
get
{
return (string)base.GetValue(TitleProperty);...