wpftoolkit

Databinding the DataGrid column header in code

感情迁移 提交于 2019-12-05 07:48:48
问题 How do I databind a WPF Toolkit DataGrid column header value in code (not XAML)? DataGridColumn fooColumn = new DataGridTextColumn { Header = "Foo", Binding = new Binding {Path = new PropertyPath("BindingPath"), Mode = BindingMode.OneWay} }; This databinds the content of the cells of the column. But how do I databind the header text ("Foo") itself (to, say, a string property on a viewmodel)? 回答1: DataGridColumn fooColumn = new DataGridTextColumn { Binding = new Binding {Path = new

How to attach Command to wpf RibbonMenuButton?

守給你的承諾、 提交于 2019-12-05 06:56:00
问题 I want to know how to attach command to RibbonMenuButton item. The following is my initial attempt but the command is never called. <ribbon:RibbonWindow x:Class="RibbonMenuDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" Title="MainWindow" x:Name="RibbonWindow" Width="640" Height="480"> <Grid x:Name="LayoutRoot">

WPF Datatrigger Visibility + Null Value

瘦欲@ 提交于 2019-12-05 01:05:50
问题 I'm beginner in WPF. I want to set Visibility to Hidden on a Radiobutton when the databind value is equal to Null. I'm using WPF Toolkit. This is my code but it doesn't work : <dg:DataGrid x:Name="dtGrdData" HorizontalScrollBarVisibility="Hidden" SelectionMode="Extended" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" CanUserSortColumns="False" AutoGenerateColumns="False" RowHeaderWidth="0" RowHeight="50" > <DataTrigger Binding="{Binding P_DAY_PRICE}" Value="{x:Null

Need themes for the WPF Toolkit controls (especially the DataGrid)

余生长醉 提交于 2019-12-04 23:45:19
问题 I just downloaded the nice themes collection from the Codeplex WPF Themes site. I like the WhisterBlue and BureauBlue themes a lot, but neither contain any styles for the new controls included in the WPF Toolkit ( DataGrid , DatePicker , and Calendar ). It seems like someone out there must have extended the themes to cover these controls, but I've had no luck finding them. So, if you have any leads, I'd love to hear them. I should also mention that I've been trying to port a Silverlight

DataGridTemplateColumn get value of cell

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 22:08:19
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? 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 cell template. what i did was add my own column for this kind of stuff, the column derives from

Programmatically create a ColumnSeries WPF Toolkit Charts

早过忘川 提交于 2019-12-04 21:40:24
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(); mySeries.Title = "TEST"; mySeries.IndependentValueBinding = new Binding("key"); mySeries

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

回眸只為那壹抹淺笑 提交于 2019-12-04 15:21:43
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; And also I have Checkbox, when you check it, it should show all row details. I am trying this code for

How to give Style to WPF Toolkit Chart

假如想象 提交于 2019-12-04 13:21:35
问题 I am using WPF Toolkit Chart with PieChart in my WPF Application. I want to change by default white background to Transparent in PieChart Picture.. How to give Style to Achieve that 回答1: If you looked at visual tree you find out that you must change Background property of grid and border to change background to transparent (elements highlighted in yellow in the below picture). To do that you can change color in Loaded event. First you must find EdgePanel with name ChartArea and after that you

Limitations of using .NET 2.0 (Windows Forms) controls in WPF?

↘锁芯ラ 提交于 2019-12-04 08:09:34
I want to start a new application on WPF . The new User interface in WPF needs DataGridView control and PropertyGrid Control. But it looks like that these two controls won't exist in WPF and I want to host these two controls using WindowsFormsHost . However, if I do that, is there any limitation anybody forsee with this approach? Ray Burns The main limitation is that you loose all the powerful features of WPF: Data binding , ControlTemplates and DataTemplates , Infinite sizing, Zooms/Rotations, Opacity , Attached Properties , just to name a few. That's a lot to give up! You'll have to program

Centering DatePicker control

耗尽温柔 提交于 2019-12-04 07:09:04
I am using datepicker control from wpf toolkit. I need to center align the content in datepicker control. How can I achieve this? Tried VerticalContentAlignment="Center". It didn't work. <Style TargetType="DatePickerTextBox"> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="Padding" Value="2" /> </Style> None of the other solutions will work because the vertical alignment of the DatePicker content (text and button) is hard coded in the default WPF style. i.e. the default WPF DatePicker style has not been written in a manner whereby the vertical alignment (among many