wpftoolkit

WPF Datagrid Cell with Validation Error Style

亡梦爱人 提交于 2019-12-07 04:44:11
问题 I am trying to change the default style of a DataGridCell (within a WPF Toolkit DataGrid) when there is a validation error. The default is a red border. How can I put my own template? Thanks. 回答1: Try this: <!-- Cell Style --> <Style x:Key="CellErrorStyle" TargetType="{x:Type TextBlock}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/> <Setter

How do you port a theme from Silverlight to WPF?

这一生的挚爱 提交于 2019-12-07 02:48:50
问题 It's "easy"! I just came across this blog post by Rudi Grobler that says it's "easy" to port a theme from Silverlight to WPF. Unfortunately, he doesn't say how to do it. Download and install I have installed both the WPF Toolkit and Silverlight Toolkit from Codeplex. I also went and dug up the source code for the theme I'm interested in (BureauBlue) (warning, this takes a little while to load), and pasted that into a fresh Resource Dictionary file in my test project. Ut oh, broken references

Programmatically create a ColumnSeries WPF Toolkit Charts

半腔热情 提交于 2019-12-06 14:18:11
问题 I am trying to programmatically add a column series to a wpf toolkit chart. My xaml is an empty chart. The code results in an unhandled exception, Object reference not set to an instance of an object. Any clues to why this does not work? <charting:Chart Name="MyChart"> my code behind is List<KeyValuePair<int,int>> testList = new List<KeyValuePair<int,int>>(); testList.Add(new KeyValuePair<int,int> (1,2)); testList.Add(new KeyValuePair<int,int> (2,3)); ColumnSeries mySeries = new ColumnSeries(

DataGridTemplateColumn get value of cell

余生长醉 提交于 2019-12-06 13:57:45
问题 I'm using the WPF DataGrid from the WPF Toolkit. I added a templated column to my DataGrid , which has a CheckBox in each cell. Now how do I access the values within these cells? My other columns in the DataGrid come from a DataSet . I can access these, but I cannot get to the values of the DataGridTemplateColumn I added to the DataGrid . Anyone have any ideas? 回答1: your into pulling stuff out of the visual tree now. and thats hard work, you cant find the binding because that is buried in the

Assigning color to the rectangle near legend items in wpf toolkit charting lineseries

你说的曾经没有我的故事 提交于 2019-12-06 11:19:01
I am adding lineseries to a chart dynamically as follows. foreach (KeyValuePair<string, List<KeyValuePair<DateTime, double>>> tempSeries in yieldSeries) { LineSeries lineSeries = new LineSeries(); lineSeries.DependentValuePath = "Value"; lineSeries.IndependentValuePath = "Key"; lineSeries.ItemsSource = tempSeries.Value; lineSeries.Title = tempSeries.Key; lineSeries.SetResourceReference(FrameworkElement.StyleProperty,"CommonLineSeries"); lineSeries.Tag = Brushes.Red; lineSeries.Background = Brushes.Red; yieldTrendChart.Series.Add(lineSeries); } I wish to assign specific color in specific order

WPF Toolkit Chart Unordered LineSeries

Deadly 提交于 2019-12-06 08:04:34
问题 The default LineSeries implementation orders data points by independed value. This gives me strange results for data like this: Is it possible to plot a line series where lines are drawn between the points in the original order? 回答1: I currently solved this by inheriting from LineSeries: class UnorderedLineSeries : LineSeries { protected override void UpdateShape() { double maximum = ActualDependentRangeAxis.GetPlotAreaCoordinate( ActualDependentRangeAxis.Range.Maximum).Value; Func<DataPoint,

How to change Text of TextBlock which is in DataTemplate of Row Details for each DataGrid Row Details?

半世苍凉 提交于 2019-12-06 07:17:03
问题 I have Datagrid which is clicking by mouse in each row is showing data grid row details. here is code, Microsoft.Windows.Controls.DataGridRow row = (Microsoft.Windows.Controls.DataGridRow)(DataGrid1.ItemContainerGenerator.ContainerFromItem(DataGrid1.SelectedItem)); DataGridDetailsPresenter presenter = FindVisualChild<DataGridDetailsPresenter>(row); DataTemplate template = presenter.ContentTemplate; TextBlock txt = (TextBlock)template.FindName("rowdetails", presenter); txt.Text = retString;

how to get the wpf toolkit datagrid to show new rows when bound to dataset

谁都会走 提交于 2019-12-06 06:58:05
Is there a way to get the wpf toolkit DataGrid to show new rows when its bound to a DataSet ? In other words, I have a DataGrid , I've set its ItemsSource to a DataTable , and everything seems to work fine, except I can't get the grid to show rows that I add to the DataTable programatically. You can set the datagrid.ItemsSource to an ObservableCollection<T> . ObservableCollection<YourItem> items = new ObservableCollection<YourItem>(); yourDataGrid.ItemsSource = items; Then you should be able to just add to the collection to get the new rows to appear: Edit: Based on updated info. if

Styling Wpf Pie Chart

孤人 提交于 2019-12-06 06:52:53
问题 Here is my xaml for the pie chart. <chartingToolkit:Chart Name="pieChart" Title="Top Products" Margin="10,10,0,0" Height="262" BorderBrush="#00000000" DataContext="{Binding}" IsHitTestVisible="False" IsTabStop="True" ForceCursor="True"> <chartingToolkit:PieSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding}" IsSelectionEnabled="True" /> <!-- Plot area--> <chartingToolkit:Chart.PlotAreaStyle> <Style TargetType="Grid"> <Setter Property="Background" Value="White"

How to see components in toolbox after adding a new reference?

微笑、不失礼 提交于 2019-12-06 04:06:12
In my project I add reference on the WPFToolkit assembly, restart Visual Studio and has not seen WPFToolkit components in my VS ToolBox window. What I do wrong? Toolbox doesn't automatically pick up components/controls in referenced assemblies. It does however automatically pick up components/controls that are built in your projects. You can right click the toolbox and choose "Customize" and you will get a dialog that lets you browse to the assembly and check off any controls that you want to appear. It might be helpful to create a new tab in the toolbox first. 来源: https://stackoverflow.com