wpftoolkit

WPF ComboBox/ListBox with MultiSelect based on Enum with Flags

安稳与你 提交于 2019-11-28 04:17:26
问题 So I may be pushing the boundaries just a bit... Basically I have the following enum, declared in C# code: [Flags] public enum FlaggedEnum : int { Option1 = 1, Option2 = 2, Option3 = 4, Option4 = 8, ... Option16 = 32768, None = 0 } This enum is a member of an object which I have successfully bound to a DataGrid object. Successfully meaning that I have bound all the other fields successfully. :) What I want to achieve here is a control where all the appropriate options above are checked, that

WPF Toolkit DataGrid column resize event

北慕城南 提交于 2019-11-28 03:07:41
问题 I am using WPF Toolkit Datagrid in one of the applications I am working on. What I want is to store the column width and displayindex as a user preference. I have achived it for column displayindex but for resize I could not find any event on the datagrid which will trigger after column size change. I have tried the "SizeChanged" event which I guess is only fired when it is initially calculating the size and that too is for the whole datagrid and not for the individual columns. Any alternate

wpf Area Chart with Different Colors?

徘徊边缘 提交于 2019-11-28 01:40:48
问题 I a musing the MS toolkit charts and cannot figure out how to change the color of the areas. I need to populate the chart dynamically which means I do not know ahead of time how many sections the area chart will have. Here is the code I have. var a = new AreaSeries { Title = "a", IndependentValuePath = "Key", DependentValuePath = "Value", Background = Brushes.Plum }; I have tried to change both the Fore Ground and Background and no dice. mcChart.Series.Add(a); a = new AreaSeries { Title = "b"

Datagrid text alignment

◇◆丶佛笑我妖孽 提交于 2019-11-28 00:35:16
问题 I was wondering if anyone had an easy way to get the text in a WPF data grid to be center aligned. I got the data grid to work just fine, but the right text alignment bothered me. I goggled some, and downloaded the wpftoolkit, but the examples either do not work, or give me a compile error. I did add the reference to the wpftoolkit to my project. Any help would be appreciated. Thank you the xaml for the data grid is as follows <WpfToolkit:DataGrid AutoGenerateColumns="True" Margin="15,15,10

Pre-sorting a DataGrid in WPF

半腔热情 提交于 2019-11-27 22:44:05
I have a DataGrid in WPF app with several columns, including a Name column. If the users switches to a particular view, I want the data to be pre-sorted by Name (and I'd like a sort arrow to appear in the Name header just as if the user had clicked that header). However, I can't find the expected properties to make this happen. I was looking for something like SortColumn , SortColumnIndex , SortDirection , etc. Is it possible to specify the default sort column and direction in markup (XAML) or is that not supported by the WPF Toolkit DataGrid ? Drew Marsh Assuming you're talking about the WPF

Wpf Toolkit. Bind DataGrid Column Header to DynamicResource

纵饮孤独 提交于 2019-11-27 22:31:24
I'm trying to bind DataColumn Header to DynamicResource using following code. <Window.Resources> <sys:String x:Key="HeaderText">Header Text</sys:String> </Window.Resources> <Grid> <tk:DataGrid> <tk:DataGrid.Columns> <tk:DataGridTextColumn Header="{DynamicResource HeaderText}" Width="100"/> </tk:DataGrid.Columns> </tk:DataGrid> </Grid> But for some strange reason column header remains empty. StaticResource however works well. Could you please help me to figure out how to bind that Header property to some DynamicResource. Try this: <Window.Resources> <sys:String x:Key="HeaderText">Header Text<

WPF Toolkit DatePicker Month/Year Only

喜夏-厌秋 提交于 2019-11-27 19:25:48
I'm using the Toolkit's Datepicker as above but I'd like to restrict it to month and year selections only, as in this situation the users don't know or care about the exact date .Obviously with the data being stored in a Datetime format there will be day stored but that doesn't concern me. Is there an easy way to tie this down? Thanks If you can use the Calendar control instead you could do <toolkit:Calendar x:Name="_calendar" DisplayModeChanged="_calendar_DisplayModeChanged" DisplayMode="Year" /> with this codebehind Private Sub _calendar_DisplayModeChanged(ByVal sender As System.Object,

How do I change the background color of a cell using WPF Toolkit Datagrid

六月ゝ 毕业季﹏ 提交于 2019-11-27 19:24:05
I'm using the WPF toolkit datagrid, and I'd like to set the background color of a cell, not the row, based on the content of the cell. For the sake of simplicity, lets say the column is called Foo and I'd like the background of the cell to be blue when Foo is 1, red when Foo is 2, Yellow when Foo is 3 and Green when Foo is greater than 3. If I can do that, I'm pretty sure I can solve any of the more complex cases that I need to deal with. You do this with Styles and DataTriggers. Just set your ElementStyle with your default background property, in this case Green, and add DataTriggers for the

Multiple Series Charts with WPFtoolkit

守給你的承諾、 提交于 2019-11-27 16:33:03
问题 Does anyone of you know the way to create multiple series charts with wpftoolkit? In a nutshell what I want is to have more dependent values for the same independent value. So far I couldn't find any comprehensive mechanism to get this working. Any help is deeply appreciated. 回答1: You might want to consider the alternatives, from past experience the charting components in the WPF Toolkit are extremely rigid and hard to extend. I've also had numerous issues with bugs in the toolkit and active

WPF DataGrid style-Silverlight DataGrid?

自闭症网瘾萝莉.ら 提交于 2019-11-27 13:39:53
问题 That's not a secret: Silverlight's DataGrid default style is beautiful while WPF's is poor. Instead of reinventing the wheel let me ask the community if anyone has copied the SL styles to use in WPF. Please take a look at the screenshots and judge for yourself how the Silverlight and WPF teams invest in their products. Silverlight default-style DataGrid: WPF default-style DataGrid (updated after Saied K's answer): 回答1: I haven't found any projects with a working Silverlight-style DataGrid ,