Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all 4964 articles
Browse latest View live

New Post: Drag column here label in datagrid

$
0
0
Awesome! That did it! Thanks very much!

Harold

New Post: Change background colour of PropertyGrid in CollectionEditor

$
0
0
Thanks very much for the prompt reply. I can now change the colour of the PropertyItem.

Is it possible to change the colour of the background of the Category, e.g. You may just be able to make out the text in the top row of the image above that says "Physical Properties".

Thanks again.

New Post: Customising the RichTextBoxFormatBar

$
0
0
Great thanks. Where can I find these XAML files?

New Post: Customising the RichTextBoxFormatBar

New Post: Change background colour of PropertyGrid in CollectionEditor

$
0
0
Hi,

There is an explicit style defined for the Expander of the Category. You will have to modify this Expander's background in the xaml file of the PropertyGrid. You can find this file here :
-Xceed.Wpf.Toolkit/PropertyGrid/Themes/Aero2.NormalColor.xaml.cs (for windows8)
-Xceed.Wpf.Toolkit/PropertyGrid/Themes/Generic.xaml (for windows7)
Simply Add something like :
Background="Red"
to this expander :
<Expander Header="{Binding Name}"
                                 Style="{StaticResource ExpanderStyle}">
and recompile the Toolkit.

New Post: ChildWindow Resizing

$
0
0
Hi,

If I run the "LiveExplorerApp", available here : https://wpftoolkit.codeplex.com/, and I run the Windows/ChildWindow sample (or the Windows/WindowContainer sample), I can reduce the size of the ChildWindow until a minimum size. But I don't see any distortion or offset positions. Do you have a sample showing this ?
Thanks.

New Post: Customising the RichTextBoxFormatBar

$
0
0
Thank you, is it normal procedure to create a new custom Control or does this XAML sit in a resource dictionary?

Sorry, new to WPF.

Created Unassigned: PropertyGrid handling of primitive controls [20762]

$
0
0
Hi,

I've am attempting to use the propertygrid in a new application so I am fairly new on using it. My application allows the user to dynamically add controls (button, label, image, rectangle, ellipse, etc) to a canvas and move and resize them. I wish to use the propertygrid to allow the user to also change properties of the control that were added.

In the process of testing I noticed that when adding a primitive control (rectangle, ellipse) and setting the SelectedObject to the newly created object the property grid gets an exception "at Xceed.Wpf.Toolkit.PropertyGrid.Editors.PrimitiveTypeCollectionEditor.ResolveValueBinding(PropertyItem propertyItem)
at Xceed.Wpf.Toolkit.PropertyGrid.Editors.TypeEditor`1.ResolveEditor(PropertyItem propertyItem)
at Xceed.Wpf.Toolkit.PropertyGrid.ObjectContainerHelperBase.GenerateChildrenEditorElement(PropertyItem propertyItem)
at Xceed.Wpf.Toolkit.PropertyGrid.ObjectContainerHelperBase.PrepareChildrenPropertyItem(PropertyItemBase propertyItem, Object item)
at Xceed.Wpf.Toolkit.PropertyGrid.PropertyGrid.OnPreparePropertyItemInternal(Object sender, PropertyItemEventArgs args)"

The inner exception was "System.IndexOutOfRange" exception. After researching the issue further by debugging "PrimitiveTypeCollectionEditor" I believe I've found the root of the problem:

* The problem in ResolveValueBinding is that "Editor.ItemType = type.GetGenericArguments()[0]" is attempting to access index 0 when for this type no generic parameters exist. Inspecting the code with debug I found the type to be {Name = "DoubleCollection" FullName = "System.Windows.Media.DoubleCollection"}

I patched the code to the see if I could get around the issue. The code patch was as follows:

// DEK Check to see if type contains generic parameters before referencing index 0
if (type.ContainsGenericParameters)
{
Editor.ItemType = type.GetGenericArguments()[0];
}

With additional testing I found the same issue occurred again in code "PrimitiveTypeCollectionControl". Again I patched the code as follows:

// DEK
if (newValue.GetType().ContainsGenericParameters)
{
if (ItemType == null)
ItemType = newValue.GetType().GetGenericArguments()[0];
}
SetText(newValue);

I've retested and my application is working as expected now with both the Ellipse and Rectangle controls. Attached are the two modules with the new modifications.
____________________________________________________________________________________________________________________________

The second issue I've encountered was while attempting to use the XamlDesignerSerializationManager(XMLWriter) to save the XAML definition of my modified form so that I could restore it later. I am able to make this work when I save reference to my Canvas that I've added my controls to but when attempting to save the XAML when referencing the Grid containing the AvalonDockManager my application abends with a stack overflow exception. I understand what causes this and have to tried to resolve it by removing any binding with child elements that reference higher parent elements - thinking this is forcing recursive calls. I have not been able to resolve this at all. I am not terribly concerned though since I am able to save my Canvas, containing all of my newly created controls, and restore it later.

While I have a workaround I wanted to let you know as this may indicate an unexpected recursive call scenario in your code. Microsoft documentation indicates that only 1000 stack entries are allowed and I'm not sure why this would be exceeded when propagating through a very simple AvalonDock layout.

____________________________________________________________________________________________________________________________
Now for a question on using PropertyDefinitions. When I add a control to my form I am able to set the SelectedObject to the new control (standard or primitive) and get all of the control properties populated into the propertygrid. My preference would be to only expose specific control properties for the user to change. I've experimented with setting the SelectedObject to the the control I want to reference and then setting the AutoGenerateProperties to False. I am attempting to inform my propertygrid which properties to show by using PropertyDefinitions but haven't had much success. I am unable to set these values in the XAML since these controls don't exist at runtime. Also I've been unable to find any examples that show how to do this properly in code. My assumption, and maybe incorrect, was that if I set propertydefinitions to existing properties that the propertygrid would handle referencing the properties and attach the necessary editordefinitions as well to handle them.

** Is it possible to add propertydefinitions in code and can you provide me with an example?

Again my workaround would be to handle the sets and gets of each property in my own code but would prefer to minimize my coding as much as possible and leverage existing propertygrid functionality.

Please let me know what you find or if you need additional information to properly respond to my findings or request for information.

Regards,

Don

New Post: Any News on 2.1

$
0
0
Kosmatos wrote:
Okay, it's available. It will be on Nuget on monday.
Forgive my being pushy, but...
  • Can you confirm that the bug (report/work item) affecting use of the CheckComboBox within a DataTemplate is resolved in community version 2.1?
  • Approximately what time (locally to you) do you plan to release community version 2.1 on NuGet (assuming that you still plan to make this available today as stated above)?
I have a project that is waiting to be pushed into UAT, but it is dependent on the bug mentioned above being fixed. If for some reason the fix is not in the 2.1 release I will download the source instead and build for myself but I would prefer not to have to do that as NuGet is so much more convenient - especially if the update is pending!

Thanks.

New Post: Any News on 2.1

$
0
0
MartinRobins wrote:
Kosmatos wrote:
Okay, it's available. It will be on Nuget on monday.
Forgive my being pushy, but...
  • Can you confirm that the bug (report/work item) affecting use of the CheckComboBox within a DataTemplate is resolved in community version 2.1?
  • Approximately what time (locally to you) do you plan to release community version 2.1 on NuGet (assuming that you still plan to make this available today as stated above)?
I have a project that is waiting to be pushed into UAT, but it is dependent on the bug mentioned above being fixed. If for some reason the fix is not in the 2.1 release I will download the source instead and build for myself but I would prefer not to have to do that as NuGet is so much more convenient - especially if the update is pending!

Thanks.
Ok; you got me!
As soon as I pressed save, the update showed up on NuGet!

Thanks.

New Post: CheckComboBox: Setting "Delimiter" to anything other than a comma

$
0
0
I am using the CheckComboBox inside a ListView/GridView but I seem unable to bind the selected items.

My [row] model (abbreviated) looks something like this...
class Model {

    private String surcharges = "PW";

    public String Surcharges {
        get { return this.surcharges; }
        set { this.surcharges = value; }
    }

    public List<Option> SurchargeOptions { get; set; }

}

class Option {

    public String Code { get; set; }
    public String Description { get; set; }

}
And the corresponding XAML looks like this...
<GridViewColumn Header="Surcharges">
    <GridViewColumn.CellTemplate>
        <DataTemplate>
            <et:CheckComboBox Delimiter=" " DisplayMemberPath="Code" ItemsSource="{Binding Path=SurchargeOptions}" MinWidth="150" SelectedValue="{Binding Path=Surcharges}" ValueMemberPath="Code" />
        </DataTemplate>
    </GridViewColumn.CellTemplate>
</GridViewColumn>
The SurchargeOptions property is set to a list of Option types prior to display, the list contains about 10 items including the "PW" option. The field on screen however does not display any content when not dropped down (I am expecting it to show "PW") and when dropped down the options are all present but none (including the "PW" are selected).

I am expecting the resulting Surcharges property to be set to a string containing each "Code" separated by a space.

I am using community edition v2.1 (downloaded from nuget); I am aware that there is an issue here and a corresponding work item here, but I was of the impression that these fixes would be in v2.1 and this now leads me to wonder if indeed I am using the control incorrectly.

Any help will be appreciated.

Thanks.

New Post: Any News on 2.1

$
0
0
It would appear however that the fix I am looking for is not included; otherwise I am using it incorrectly!
I have raised a separate issue.

New Post: CheckComboBox: Setting "Delimiter" to anything other than a comma

$
0
0
I have updated the title of this discussion following some further discovery...

If I change the Delimiter property of the CheckComboBox back to a comma (","), and make the corresponding changes within the model, the control works as expected. If I try and set the delimiter to anything other than a comma (I say anything, I have tried a space, a colon and a forward slash), the control does not work any more.

Working (updates to above)...
public class Model {
    public String Surcharges {
        get { return (this.surcharges ?? String.Empty).Replace(@" ", @","); }
        set { this.surcharges = (value ?? String.Empty).Replace(@",", @" "); }
    }
}

<et:CheckComboBox Delimiter=","
    DisplayMemberPath="PalletNetworkSurchargeCode"
    ItemsSource="{Binding Path=SurchargeOptions}"
    MinWidth="150"
    SelectedValue="{Binding Path=Surcharges}"
    ValueMemberPath="PalletNetworkSurchargeCode" />
Not working (similar updates to the above)...
public class Model {
    public String Surcharges {
        get { return (this.surcharges ?? String.Empty).Replace(@" ", @"/"); }
        set { this.surcharges = (value ?? String.Empty).Replace(@"/", @" "); }
    }
}

<et:CheckComboBox Delimiter="/"
    DisplayMemberPath="PalletNetworkSurchargeCode"
    ItemsSource="{Binding Path=SurchargeOptions}"
    MinWidth="150"
    SelectedValue="{Binding Path=Surcharges}"
    ValueMemberPath="PalletNetworkSurchargeCode" />

Created Issue: CheckComboBox: Delimiter other than a comma = no selection [20763]

$
0
0
Based on discussion https://wpftoolkit.codeplex.com/discussions/534906.

When a CheckComboBox is used in a DataTemplate, has a SelectedValue and its Delimiter is something else than a coma, the selectedValue is not active when loaded.

New Post: CheckComboBox: Setting "Delimiter" to anything other than a comma


Edited Issue: CheckComboBox: Delimiter other than a comma = no selection [20763]

$
0
0
Based on discussion https://wpftoolkit.codeplex.com/discussions/534906.

When a CheckComboBox is used in a DataTemplate, has a SelectedValue and its Delimiter is something else than a coma, the selectedValue is not active when loaded.
Comments: ** Comment from web user: BoucherS **

This issue will be fixed in v2.3.

In the meantime, you do the following modification in file :
Xceed.Wpf.Toolkit/Core/Primitives/Selector.cs
In method :
OnDelimiterChanged
Replace :
```
( ( Selector )o ).UpdateSelectedValue();
```
with :
```
Selector selector = (Selector)o;
if( selector.IsInitialized )
{
selector.UpdateSelectedValue();
}
```

New Post: validation with minus sign

$
0
0
I'm creating a MaskedTextBox with Mask = "#999.99" and ValueDataType Decimal
However when I enter (e.g.) -123.45 as input I get validation errors. Only positive numbers work. I also can't set the value from code behind to a negative number or else I'll get the following error:

The value representation '-0001,20' does not match the mask.
Parameter name: value


Is this some error in the MaskedTextBox component or am I using it wrongly?

Patch Uploaded: #15915

$
0
0

jaredthirsk has uploaded a patch.

Description:
Allow the user to determine their own logic for determining whether a PropertyGrid property should be expandable.

e.g.
private static bool IsExpandablePredicate(object item)
{
PropertyDescriptor property = item as PropertyDescriptor;
var tca = property.PropertyType.GetCustomAttribute<TypeConverterAttribute>();
if (tca != null)
{
return tca.ConverterTypeName == typeof(ExpandableObjectConverter).AssemblyQualifiedName;
}
return false;
}

void InitCode()
{
Xceed.Wpf.Toolkit.PropertyGrid.PropertyGrid.IsExpandablePredicate = IsExpandablePredicate;
}

Commented Unassigned: Allow complex type property to be expanded without ExpandableObject attribute [20692]

$
0
0
I have looked into the source code and can see how DescriptorPropertyDefinition.ComputeExplandableAttribute works, but unfortunately this class is all internal so I cannot modify it to use an "unobtrusive" approach to property expansion.

In my opinion its better to first have a way to accomplish something without adding an intrusive attribute, because adding an attribute requires you to own the code of the type you are inspecting. This is often not the case.
Comments: ** Comment from web user: jaredthirsk **

I agree! Down with view-DLL attributes being required in model code!!!!

Here's a patch. It's quick and hacky, but I don't care...

Created Unassigned: how to use CheckComboBox with mvvm [20766]

$
0
0
hi
I am using the CheckComboBox ver 2.0.0 in my wpf mvvm project
but I seem unable to bind the selecteditems. when Bind selecteditems to a property in wpf exception errror
SelectedItems="{Binding SelectedItemAccountUnitGroup }
error:
'SelectedItems' property is read-only and cannot be set from markup. Line

how to save All checked items CheckComboBox to database?

i am using EF code First And Mvvm


but only one checked item CheckComboBox save to database

__this is my code__
__binding in wpf window:__
<xceedtoolkit:CheckComboBox Grid.Row="2" Grid.Column="3" Name="xccedcheck"
ItemsSource="{Binding AccountUnitGroupList }"
DisplayMemberPath="AccUnitGroupName"
ValueMemberPath="AccUnitGroupID"
SelectedValue="{Binding AccountUnitData.AccUnitGroupID}"
SelectedMemberPath="{Binding SelectedItemAccountUnitGroup, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

IsDropDownOpen="false"
MaxDropDownHeight="100">

i am using SelectedValue="{Binding AccountUnitData.AccUnitGroupID}" to save to database but this metod only one checked item save

===========================================
viewmodel:

public AccountUnit AccountUnitData { get; set; } //this field for new Instance of my model in view model

public ObservableCollection<AccountUnitGroup> AccountUnitGroupList { get; set; }//this list load mylist to CheckComboBox

private AccountUnitGroup _selectedItemAccountUnitGroup;

public AccountUnitGroup SelectedItemAccountUnitGroup // this field for binding to SelectedItem or SelectedItems
{
get { return _selectedItemAccountUnitGroup; }
set
{
if (_selectedItemAccountUnitGroup != value)
{
_selectedItemAccountUnitGroup = value;

NotifyPropertyChanged("SelectedItemAccountUnitGroup");
}
}
}


please help me by sample with mvvm

thanks
Viewing all 4964 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>