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

Created Unassigned: EditorTemplateDefinition of PropertyGrid for readonly property is not work on v2.2.1 Community Edition. [21089]

$
0
0
Hello.

I found that `PropertyGrid.EditorDefinitions` of some properties was not work on v2.2.1 Community Edition.
Rows for those properties show `toString` text simply.
Those properties don't have setter. (return object, and bind to the object's property in `EditorTemplateDefinition.EditingTemplate` )

I have used `EditorTemplateDefinition` as follow:

```xaml
<xctk:EditorTemplateDefinition>
<xctk:EditorTemplateDefinition.TargetProperties>
<xctk:TargetPropertyType Type="my:CalculatorUpDownViewModel" />
</xctk:EditorTemplateDefinition.TargetProperties>

<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate DataType="xctk:PropertyItem">
<xctk:CalculatorUpDown
Value ="{Binding Value.Value}"
Minimum ="{Binding Value.Minimum}"
Maximum ="{Binding Value.Maximum}"
Increment ="{Binding Value.Increment}"
IsEnabled ="{Binding Value.IsEnabled}"
FormatString="{Binding Value.FormatString}"
/>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
```

```cs
class MyViewModel {
[DisplayName("DisplayName")]
public CalculatorUpDownViewModel MyProperty
{
get { return this.myProperty; }
// set { }
}
...
}
```

It gets correct working again if I add empty setter into the property.
I think that `EditorTemplateDefinition` should work even if the model's property hasn't have setter.
Actually it had worked until v2.2.0 Community Edition.

Thanks.

Updated Wiki: Home

$
0
0
June 17, 2014 update: Released v2.2.1 with bug fixes and lowered the price of the Plus Edition to $99.95 until Aug. 30, 2014. Please support the project. On June 2, 2014, released v2.2.0 with 2 new controls and 15 bug fixes and improvements. Users of the Plus Edition got 2 more controls in v2.2.0 and received v2.3.0 with 1 new control and 30 new bug fixes and improvements (see list).

Try the controls now with the Live Explorer app.

Extended WPF Toolkit Plus

Extended WPF Toolkit™ is the number one collection of WPF controls, components and utilities for creating next generation Windows applications. Use it to build professional looking, modern, and easy to use line of business applications. The Extended WPF Toolkit project has been downloaded more than 250,000 times here and on Nuget.

The free, open source Community Edition is provided under the Microsoft Public License. The Plus Edition adds additional controls and features, email support, and is one release version ahead. The Business Suite for WPF adds the full-featured version of the industry's best datagrid and 1-year of priority support and updates.

Controls included in the Community Edition:

AvalonDockAutoSelectTextBoxBusyIndicatorButtonSpinner
ByteUpDownCalculatorCalculatorUpDownCheckComboBox
CheckListBoxChildWindowCollectionControlCollectionControlDialog
ColorCanvasColorPickerDataGridDateTimePicker
DateTimeUpDownDecimalUpDownDoubleUpDownDropDownButton
IntegerUpDownLongUpDownMagnifierMaskedTextBox
MessageBoxMultiLineTextEditorPieChartPrimitiveTypeCollEditor
PropertyGridRangeSliderRichTextBoxRichTextBoxFormatBar
ShortUpDownSingleUpDownSplitButtonSwitchPanel
TimelinePanelTimePickerTimeSpanUpDownValueRangeTextBox
WatermarkTextBoxWindowContainerWindowControlWizard
Zoombox Windows 8 Theme

Additional controls and features in the Plus Edition:

ChartsChildWindow PlusMessageBox PlusMultiColumnComboBox
PileFlowPanelPropertyGrid PlusRadialGaugeRating
StyleableWindowSwitchPanel PlusToggleSwitchUltimate ListBox
WindowControl Plus Metro theme Office theme Technical support
1 release ahead

Additional controls and features in the Business Suite for WPF:

Advanced DataGrid 3D Views for WPF Blendables for WPF More themes

Latest News

 
Bitcoin You can purchase with bitcoins and get a 1-year, 1-developer subscription for the Plus Edition for only 0.15 BTC. Just scroll down to the bottom of any page on http://wpftoolkit.com and select 'Pay with Bitcoin'.
  • June 17, 2014, released Plus Edition v2.2.1 containing 5 bug fixes (see list) and a new lower price to get the Plus Edition until August 30, 2014. Plus Edition v2.3.1 released with 6 bug fixes.
  • June 2, 2014, released Plus Edition v2.3.0 containing a new controls and 30 bug fixes and improvements. Released Community Edition v2.2.0, containing two new controls and 15 bug fixes and improvements (see list).
  • Feb. 20, 2014, released Plus Edition v2.2.0 containing 4 new controls and 20 bug fixes and improvements. Released Community Edition v2.1.0, containing 70 bug fixes and improvements (see list).
 
Extended WPF Toolkit Plus

Action items

  • Enjoy WPF!
  • Please rate this release and write something positive. It's at the bottom of the downloads page
  • Follow this project (click "follow" at the top right of this page)
  • Follow @datagrid on Twitter for WPF and Toolkit news
  • Like Xceed's WPF page on Facebook
  • Check out a video or two on XceedVideos YouTube Channel
  • Add bugs or feature requests to the Issue Tracker

community-full.png

Edited Issue: PropertyGrid: Custom Items Source and ReadOnly Attribute [21038]

$
0
0
Based on discussion : https://wpftoolkit.codeplex.com/discussions/546988
Comments: ** Comment from web user: BoucherS **

Correction Fixed in v2.2.1

Commented Unassigned: EditorTemplateDefinition of PropertyGrid for readonly property is not work on v2.2.1 Community Edition. [21089]

$
0
0
Hello.

I found that `PropertyGrid.EditorDefinitions` of some properties was not work on v2.2.1 Community Edition.
Rows for those properties show `toString` text simply.
Those properties don't have setter. (return object, and bind to the object's property in `EditorTemplateDefinition.EditingTemplate` )

I have used `EditorTemplateDefinition` as follow:

```xaml
<xctk:EditorTemplateDefinition>
<xctk:EditorTemplateDefinition.TargetProperties>
<xctk:TargetPropertyType Type="my:CalculatorUpDownViewModel" />
</xctk:EditorTemplateDefinition.TargetProperties>

<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate DataType="xctk:PropertyItem">
<xctk:CalculatorUpDown
Value ="{Binding Value.Value}"
Minimum ="{Binding Value.Minimum}"
Maximum ="{Binding Value.Maximum}"
Increment ="{Binding Value.Increment}"
IsEnabled ="{Binding Value.IsEnabled}"
FormatString="{Binding Value.FormatString}"
/>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
```

```cs
class MyViewModel {
[DisplayName("DisplayName")]
public CalculatorUpDownViewModel MyProperty
{
get { return this.myProperty; }
// set { }
}
...
}
```

It gets correct working again if I add empty setter into the property.
I think that `EditorTemplateDefinition` should work even if the model's property hasn't have setter.
Actually it had worked until v2.2.0 Community Edition.

Thanks.
Comments: ** Comment from web user: BoucherS **

Hi,

Based on this discussion : https://wpftoolkit.codeplex.com/discussions/546988,
if someone is using a one of these combination as attributes on a property :
-ItemsSourceAttribute and ReadOnlyAttribute(true)
-EditorAttribute and ReadOnlyAttribute(true)
the ReadOnly was not applied on the property in the PropertyGrid.

With the fix in v2.2.1, this issue doesn't happens anymore.

On the other hand, you have the problem you found : a property without a setter won't use its EditingTemplate. This is because it is a readOnly property : no setter. So to be able to use any kind of editor, the property needs to have a setter or else it is readonly by default.

I think it is not a normal behavior to have a property with only a getter and define its editingTemplate in XAML.

Commented Issue: Dispather.BeginInvoke with Background priority causing focus issues [21085]

$
0
0
This issue I have discussed previously in https://avalondock.codeplex.com/workitem/15976.

In AvalonDock there are few calls to Dispather.BeginInvoke with priority set as Background. This causes lot of unpredictable behaviors. I believe this should be at least Input priority.

I do not know how long you will take to fix this issue because after the AvalonDock project is overtaken it takes about 6 months to get new bug fixes, which is really bad. If there is any possibility please fix this issue and post to open source code.
Comments: ** Comment from web user: BoucherS **

In v2.4, the priority has been changed from Background to Input when Dispatcher.BeginInvoke is used with FocusElementManager.SetFocusOnLastElement.

New Post: Applying Styles to each column in Grid Dynamically

$
0
0
Hi,

In your example, each row contains a Foreground. When you set the Column[1].CellContentTemplate, to a DataTemplate binding on row.Foreground, it will work. But if you try to use the same CellContentTemplate on Column[2], the row is the same, with the same Foreground, so will be similar the Column[1]'s foreground. And this is the same for all Font properties.

An idea is to reset the Column's CellContentTemplate. So you pre-define some DataTemplates in the Resources (TextBlock with Foreground, FontFamily...). When you need to change the Display of items in Column[1], you just get the wanted DataTemplate from the resource (or build it in code-behind) and apply it on column[1] :
//Get the DataTemplate in Resources or create one in code-behind
DataTemplate newTemplate = this.ResultGrid.Resources[ "test2Template" ] as DataTemplate;
if( newTemplate != null )
{
   this.ResultGrid.Columns[ "FirstName" ].CellContentTemplate = newTemplate;
}
Another option is to define a ViewModel with Foreground and Font properties...as Dependency properties :
public class MyViewModel : DependencyObject
  {
    public Brush Foreground
    {
      get
      {
        return ( Brush )GetValue( ForegroundProperty );
      }
      set
      {
        SetValue( ForegroundProperty, value );
      }
    }

    public static readonly DependencyProperty ForegroundProperty = DependencyProperty.Register( "Foreground", typeof( Brush ), typeof( MyViewModel ),
                                                                  new UIPropertyMetadata(
                                                                  new SolidColorBrush(Colors.Black) ) );
  }
Then in the resource, define as many of these as you have columns ;
<local:MyViewModel x:Key="View1"  Foreground="Green"/> 
The column's CellContentTemplate can then bind to the corresponding ViewModel's properties in its DataTemplate :
<DataTemplate x:Key="test1Template">
                  <TextBlock Text="{Binding}"
                             Foreground="{Binding Foreground, Source={StaticResource View1}}"/>
               </DataTemplate>
When you need to change dynamically those properties, you just change them on the ViewModels that you retrieve from Resources ;
MyViewModel viewModel2 = this.Resources[ "View2" ] as MyViewModel;
      if( viewModel2 != null )
      {
        viewModel2.Foreground = new SolidColorBrush( Colors.Pink );
      }

Commented Unassigned: EditorTemplateDefinition of PropertyGrid for readonly property is not work on v2.2.1 Community Edition. [21089]

$
0
0
Hello.

I found that `PropertyGrid.EditorDefinitions` of some properties was not work on v2.2.1 Community Edition.
Rows for those properties show `toString` text simply.
Those properties don't have setter. (return object, and bind to the object's property in `EditorTemplateDefinition.EditingTemplate` )

I have used `EditorTemplateDefinition` as follow:

```xaml
<xctk:EditorTemplateDefinition>
<xctk:EditorTemplateDefinition.TargetProperties>
<xctk:TargetPropertyType Type="my:CalculatorUpDownViewModel" />
</xctk:EditorTemplateDefinition.TargetProperties>

<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate DataType="xctk:PropertyItem">
<xctk:CalculatorUpDown
Value ="{Binding Value.Value}"
Minimum ="{Binding Value.Minimum}"
Maximum ="{Binding Value.Maximum}"
Increment ="{Binding Value.Increment}"
IsEnabled ="{Binding Value.IsEnabled}"
FormatString="{Binding Value.FormatString}"
/>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
```

```cs
class MyViewModel {
[DisplayName("DisplayName")]
public CalculatorUpDownViewModel MyProperty
{
get { return this.myProperty; }
// set { }
}
...
}
```

It gets correct working again if I add empty setter into the property.
I think that `EditorTemplateDefinition` should work even if the model's property hasn't have setter.
Actually it had worked until v2.2.0 Community Edition.

Thanks.
Comments: ** Comment from web user: Toru_Nagashima **

Thank you for reply.

I think that a property without setter is not always readonly, because the property can have a reference to a mutable object as its value.
In order to edit that kind of the property that has a mutable value, I have used custom editors.
Of course, the property doesn't have the attribute [ReadOnly(true)].

Commented Issue: Dispather.BeginInvoke with Background priority causing focus issues [21085]

$
0
0
This issue I have discussed previously in https://avalondock.codeplex.com/workitem/15976.

In AvalonDock there are few calls to Dispather.BeginInvoke with priority set as Background. This causes lot of unpredictable behaviors. I believe this should be at least Input priority.

I do not know how long you will take to fix this issue because after the AvalonDock project is overtaken it takes about 6 months to get new bug fixes, which is really bad. If there is any possibility please fix this issue and post to open source code.
Comments: ** Comment from web user: zebrajap **

Where is v2.4?


New Post: Applying Styles to each column in Grid Dynamically

$
0
0
Thank you for your answer. Could you please upload XAML Code? I have tried the above one, Style is not applied properly to Column.

Commented Unassigned: EditorTemplateDefinition of PropertyGrid for readonly property is not work on v2.2.1 Community Edition. [21089]

$
0
0
Hello.

I found that `PropertyGrid.EditorDefinitions` of some properties was not work on v2.2.1 Community Edition.
Rows for those properties show `toString` text simply.
Those properties don't have setter. (return object, and bind to the object's property in `EditorTemplateDefinition.EditingTemplate` )

I have used `EditorTemplateDefinition` as follow:

```xaml
<xctk:EditorTemplateDefinition>
<xctk:EditorTemplateDefinition.TargetProperties>
<xctk:TargetPropertyType Type="my:CalculatorUpDownViewModel" />
</xctk:EditorTemplateDefinition.TargetProperties>

<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate DataType="xctk:PropertyItem">
<xctk:CalculatorUpDown
Value ="{Binding Value.Value}"
Minimum ="{Binding Value.Minimum}"
Maximum ="{Binding Value.Maximum}"
Increment ="{Binding Value.Increment}"
IsEnabled ="{Binding Value.IsEnabled}"
FormatString="{Binding Value.FormatString}"
/>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
```

```cs
class MyViewModel {
[DisplayName("DisplayName")]
public CalculatorUpDownViewModel MyProperty
{
get { return this.myProperty; }
// set { }
}
...
}
```

It gets correct working again if I add empty setter into the property.
I think that `EditorTemplateDefinition` should work even if the model's property hasn't have setter.
Actually it had worked until v2.2.0 Community Edition.

Thanks.
Comments: ** Comment from web user: BoucherS **

Hi,

I take note of this. until further investigation, please use an empty setter in your property:
```
set { }
```

Thanks.

Commented Issue: Dispather.BeginInvoke with Background priority causing focus issues [21085]

$
0
0
This issue I have discussed previously in https://avalondock.codeplex.com/workitem/15976.

In AvalonDock there are few calls to Dispather.BeginInvoke with priority set as Background. This causes lot of unpredictable behaviors. I believe this should be at least Input priority.

I do not know how long you will take to fix this issue because after the AvalonDock project is overtaken it takes about 6 months to get new bug fixes, which is really bad. If there is any possibility please fix this issue and post to open source code.
Comments: ** Comment from web user: BoucherS **

Hi,

It is the next planned release. No official date yet.

New Post: Applying Styles to each column in Grid Dynamically

$
0
0
Hi,

Here's the sample for option 2), using a ViewModel by column.
<Window x:Class="WpfApplication75.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:local="clr-namespace:WpfApplication75"
        Title="MainWindow" Height="350" Width="1000">
   <Window.Resources>
      <local:MyViewModel x:Key="View1"
                         Foreground="Green"/>
      <local:MyViewModel x:Key="View2"
                         Foreground="Green" />
   </Window.Resources>
    
   <Grid>
      <StackPanel>
         <xcdg:DataGridControl x:Name="ResultGrid"
                               AutoCreateColumns="False">
            <xcdg:DataGridControl.Resources>
               <DataTemplate x:Key="test1Template">
                  <TextBlock Text="{Binding}"
                             Foreground="{Binding Foreground, Source={StaticResource View1}}"/>
               </DataTemplate>
               <DataTemplate x:Key="test2Template">
                  <TextBlock Text="{Binding}"
                             Foreground="{Binding Foreground, Source={StaticResource View2}}" />
               </DataTemplate>               
            </xcdg:DataGridControl.Resources>

            <xcdg:DataGridControl.Columns>
               <xcdg:Column Title="id"
                            FieldName="ID">
               </xcdg:Column>

               <xcdg:Column Title="name"
                            FieldName="FirstName"
                            IsMainColumn="True"
                            CellContentTemplate="{StaticResource test1Template}" />
               <xcdg:Column Title="last"
                            FieldName="LastName"
                            CellContentTemplate="{StaticResource test2Template}" />
            </xcdg:DataGridControl.Columns>

         </xcdg:DataGridControl>
         <Button Content="Click Me"
                 Click="Button_Click" />
      </StackPanel>
   </Grid>
</Window>

namespace WpfApplication75
{
  /// <summary>
  /// Interaction logic for MainWindow.xaml
  /// </summary>
  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();

      this.Results = new ObservableCollection<TestCaseResult>() 
      {
        new TestCaseResult() { ID = 1, FirstName = "AA", LastName = "AAAA" },
        new TestCaseResult() { ID = 1, FirstName = "BB", LastName = "BBBB" },
        new TestCaseResult() { ID = 1, FirstName = "CC", LastName = "CCCC" },
        new TestCaseResult() { ID = 1, FirstName = "DD", LastName = "DDDD"},
        new TestCaseResult() { ID = 1, FirstName = "EE", LastName = "EEEE" },
        new TestCaseResult() { ID = 1, FirstName = "FF", LastName = "FFFF" },
      };
      DataGridCollectionView collectionView = new DataGridCollectionView( this.Results );
      ResultGrid.ItemsSource = collectionView;
    }

    public ObservableCollection<TestCaseResult> Results
    {
      get;
      set;
    }

    private void Button_Click( object sender, RoutedEventArgs e )
    {
      MyViewModel viewModel = this.Resources[ "View1" ] as MyViewModel;
      if( viewModel != null )
      {
        viewModel.Foreground = new SolidColorBrush(Colors.Yellow);
      }
      MyViewModel viewModel2 = this.Resources[ "View2" ] as MyViewModel;
      if( viewModel2 != null )
      {
        viewModel2.Foreground = new SolidColorBrush( Colors.Pink );
      }
    }
  }

  public class TestCaseResult
  {
    public int ID
    {
      get;
      set;
    }

    public string FirstName
    {
      get;
      set;
    }

    public string LastName
    {
      get;
      set;
    }
  }

  public class MyViewModel : DependencyObject
  {
    public Brush Foreground
    {
      get
      {
        return ( Brush )GetValue( ForegroundProperty );
      }
      set
      {
        SetValue( ForegroundProperty, value );
      }
    }

    public static readonly DependencyProperty ForegroundProperty = DependencyProperty.Register( "Foreground", typeof( Brush ), typeof( MyViewModel ),
                                                                  new UIPropertyMetadata(
                                                                  new SolidColorBrush(Colors.Black) ) );
  }
}

Commented Issue: Dispather.BeginInvoke with Background priority causing focus issues [21085]

$
0
0
This issue I have discussed previously in https://avalondock.codeplex.com/workitem/15976.

In AvalonDock there are few calls to Dispather.BeginInvoke with priority set as Background. This causes lot of unpredictable behaviors. I believe this should be at least Input priority.

I do not know how long you will take to fix this issue because after the AvalonDock project is overtaken it takes about 6 months to get new bug fixes, which is really bad. If there is any possibility please fix this issue and post to open source code.
Comments: ** Comment from web user: zebrajap **

hmmm. It is not a good news. At least we have no way of knowing whether your change fixes our issue.

New Post: Need to display RowCount & Rowheader in Grouping

$
0
0
Hi,
I need to display the Row item Count with the Header & the RowHeader within the expand result, is it possible to have it as in the attachment.Image

New Post: Applying Styles to each column in Grid Dynamically

$
0
0
thank you Mr.Boucher. Its working for me.

When apply the Foreground based on the cell values, the style is not applying properly.
For example: I want to apply the Red Color only the cell contains Value "CC" in Column Firstname.

But , It is not working When I apply same logic to FontFamily , FontSize , FontStretch, FontWeight , FontStyle. is there any other way to apply those styles for each column? Please help me.

Commented Issue: Dispather.BeginInvoke with Background priority causing focus issues [21085]

$
0
0
This issue I have discussed previously in https://avalondock.codeplex.com/workitem/15976.

In AvalonDock there are few calls to Dispather.BeginInvoke with priority set as Background. This causes lot of unpredictable behaviors. I believe this should be at least Input priority.

I do not know how long you will take to fix this issue because after the AvalonDock project is overtaken it takes about 6 months to get new bug fixes, which is really bad. If there is any possibility please fix this issue and post to open source code.
Comments: ** Comment from web user: BoucherS **

Hi,

Haven't you tried replacing the Background property to Input property ? This is mainly the purpose of this fix. You can try making the change in DockingManager.OnLayoutRootPropertyChanged and in FocusElementManager.WindowActivating and see if it fits your needs.

New Post: Applying Styles to each column in Grid Dynamically

$
0
0
Hi,

1) If you want to apply a red foreground color only to the cell with Value equals "CC" in Column Firstname, you can use a DataTrigger in the "test1Template" :
<DataTemplate x:Key="test1Template">
                  <TextBlock x:Name="_textBlock"
                             Text="{Binding}"
                             Foreground="{Binding Foreground, Source={StaticResource View1}}"/>
                  <DataTemplate.Triggers>
                     <DataTrigger Binding="{Binding Path=.}"
                                  Value="CC">
                        <Setter Property="Foreground"
                                Value="Red" 
                                TargetName="_textBlock"/>
                     </DataTrigger>
                  </DataTemplate.Triggers>
</DataTemplate>
If you want to apply it to all the cells that contains "CC", you can use a converter in the binding of the DataTrigger to get them.

2) I tried it with FontSize, and it worked :
<DataTemplate x:Key="test1Template">
                  <TextBlock Text="{Binding}"
                             Foreground="{Binding Foreground, Source={StaticResource View1}}"
                             FontSize="{Binding FontSize, Source={StaticResource View1}}"/>
</DataTemplate>

 public class MyViewModel : DependencyObject
  {
    //.....

    public double FontSize
    {
      get
      {
        return ( double )GetValue( FontSizeProperty );
      }
      set
      {
        SetValue( FontSizeProperty, value );
      }
    }

    public static readonly DependencyProperty FontSizeProperty = DependencyProperty.Register( "FontSize", typeof( double ), typeof( MyViewModel ),
                                                                  new UIPropertyMetadata( 11d ) );
  }

private void Button_Click( object sender, RoutedEventArgs e )
    {
      MyViewModel viewModel = this.Resources[ "View1" ] as MyViewModel;
      if( viewModel != null )
      {
        viewModel.Foreground = new SolidColorBrush(Colors.Yellow);
        viewModel.FontSize = 20d;
      }
    }

New Post: Need to display RowCount & Rowheader in Grouping

$
0
0
Hi,

I believe you are using the DataGrid from the Xceed.Wpf.Toolkit.

1) To display the number of items in the group, you can define a DataTemplate for groups that displays in red the quantity of items.
2) To display the columnManagerRow in the publisher's groupConfiguration, you can redefine the groupConfiguration of this specific column.

Here's the XAML for the 2 modifications :
<Window.Resources>
      <DataTemplate x:Key="defaultGroupTemplate">
         <StackPanel Orientation="Horizontal"
                     VerticalAlignment="Center">
            <ContentPresenter Content="{Binding Value}"
                              ContentTemplate="{Binding RelativeSource={RelativeSource TemplatedParent},Path=DataContext.ValueTemplate}"
                              ContentTemplateSelector="{Binding RelativeSource={RelativeSource TemplatedParent},Path=DataContext.ValueTemplateSelector}"
                              VerticalAlignment="Center" />
            <TextBlock Text=" ("
                       Foreground="Red"
                       VerticalAlignment="Center" />
            <TextBlock Text="{Binding ItemCount}"
                       Foreground="Red"
                       VerticalAlignment="Center" />
            <TextBlock Text=")"
                       Foreground="Red"
                       VerticalAlignment="Center" />

         </StackPanel>
      </DataTemplate>

      <DataTemplate  DataType="{x:Type xcdg:Group}">
         <ContentControl x:Name="groupContentPresenter"
                         Focusable="False"
                         Content="{Binding}"
                         ContentTemplate="{StaticResource defaultGroupTemplate}" />
      </DataTemplate>

      <xcdg:GroupConfiguration x:Key="PublisherGroupConfiguration">
         <xcdg:GroupConfiguration.Headers>
            <DataTemplate>
               <xcdg:ColumnManagerRow />
            </DataTemplate>
         </xcdg:GroupConfiguration.Headers>
      </xcdg:GroupConfiguration>
   </Window.Resources>
    
   <Grid>
      <xcdg:DataGridControl x:Name="_datagrid">
         <xcdg:DataGridControl.Columns>
            <xcdg:Column FieldName="GameName"
                         IsMainColumn="True">
            </xcdg:Column>

            <xcdg:Column FieldName="Creator">
            </xcdg:Column>

            <xcdg:Column FieldName="Owner">
            </xcdg:Column>

            <xcdg:Column FieldName="Publisher"
                         GroupConfiguration="{StaticResource PublisherGroupConfiguration}">
            </xcdg:Column>
         </xcdg:DataGridControl.Columns>
      </xcdg:DataGridControl>
</Grid>

New Post: XCeed DataGrid for WPF Binding

$
0
0
Turns out the white edges weren't margins, but rather they were padding on the cell. In case people come across this problem.

New Post: Datagrid GetContainerFromItem returns null

$
0
0
I'm calling GetContainerFromItem, but for some reason, it's returning null. The item is in view and should have a valid container. However, when I was debugging this, I threw a test MessageBox.Show() just prior to the GetContainerFromItem call, and that allowed the function to return proper results, but as soon as I take out the MessageBox, the call fails again.

What could cause this sort of behaviour? Does the MessageBox trigger something from the datagrid that would allow the call to go through properly? GetContainerFromIndex also gives similar results.
Viewing all 4964 articles
Browse latest View live


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