wpftoolkit

Hide legend of WPF Toolkit chart with more than one data series

白昼怎懂夜的黑 提交于 2019-11-27 11:39:55
问题 I am trying to use charts from the WPF Toolkit (with LineSeries) and I don't want a legend at all. I need this since I have 10 such charts each with data from a different source and I would like to draw one legend for all 10, to save screen real estate. By default the legend appears the moment you add a second LineSeries. Is there any way to prevent it from even appearing? Thanks, sprite. 回答1: There doesn't seem to be an especially clean way. One simple approach is to set the Legend's Width

Problem binding DataGridComboBoxColumn.ItemsSource

大城市里の小女人 提交于 2019-11-27 08:43:43
I have 3 tables: Item - which is the DataContext - it has a navigation column Group Group - has a navigation column Category. I want to have in the DataGrid both (Category & Group) columns and when I choose a category it should display in the group col only the Category.Groups. Here is the code I am working on: <tk:DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}"> <tk:DataGrid.Columns> <!--Works--> <tk:DataGridComboBoxColumn Header="Categroy" DisplayMemberPath="Title" SelectedValuePath="CategoryId" SelectedValueBinding="{Binding Group.Category.CategoryId}" ItemsSource="{Binding

How to loop over the rows of a WPF toolkit Datagrid

限于喜欢 提交于 2019-11-27 05:38:09
I have the next code where I defined a WPF toolkit datagrid control called dgQuery; I filled this one with information of a dataset, then I inserted a new checkbox column in dgQuery to check/uncheck some of the rows, I show part of my C# code: dgQuery.DataContext = dS.Tables[0]; DataGridTemplateColumn cbCol = new DataGridTemplateColumn(); cbCol.Header = "Opc"; FrameworkElementFactory factory = new FrameworkElementFactory(typeof(CheckBox)); Binding bind = new Binding("IsSelected"); bind.Mode = BindingMode.TwoWay; factory.SetValue(CheckBox.IsCheckedProperty, bind); DataTemplate cellTemplate =

WPF StringFormat on Label Content

痞子三分冷 提交于 2019-11-27 03:11:42
I want to format my string binding as Amount is X where X is a property bound to a label. I've seen many examples but the following doesn't work: <Label Content="{Binding Path=MaxLevelofInvestment, StringFormat='Amount is {0}'}" /> I've also tried these combinations: StringFormat=Amount is {0} StringFormat='Amount is {}{0}' StringFormat='Amount is \{0\}' I even tried changing the binding property's datatype to int , string and double . Nothing seems to work. This is a very common use case but doesn't seem to be supported. Ray Burns The reason this doesn't work is that the Label.Content

Free WPF Carousel Implementation [closed]

对着背影说爱祢 提交于 2019-11-27 01:40:22
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I have seen a lot of Carousels to show off WPF. I have never really need one before now though. Is there a decent free one? I have access to the Dev Express one, but I am making an open source project and would rather not put code in it that others cannot easily compile. 回答1: After some searching, I (re)found

Pre-sorting a DataGrid in WPF

旧时模样 提交于 2019-11-26 23:12:49
问题 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)

Wpf Toolkit. Bind DataGrid Column Header to DynamicResource

限于喜欢 提交于 2019-11-26 23:05:04
问题 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

Changing the string format of the WPF DatePicker

半城伤御伤魂 提交于 2019-11-26 22:06:38
I need to change the string format of the DatePickerTextBox in the WPF Toolkit DatePicker, to use hyphens instead of slashes for the seperators. Is there a way to override this default culture or the display string format? 01-01-2010 I have solved this problem with a help of this code. Hope it will help you all as well. <Style TargetType="{x:Type DatePickerTextBox}"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate> <TextBox x:Name="PART_TextBox" Text="{Binding Path=SelectedDate, StringFormat='dd MMM yyyy', RelativeSource={RelativeSource AncestorType={x:Type DatePicker}}}"

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

梦想与她 提交于 2019-11-26 19:51:48
问题 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. 回答1: You do this with Styles and DataTriggers. Just

Windows 7 theme for WPF?

谁说我不能喝 提交于 2019-11-26 18:28:54
Is there any way to make a WPF app look like it's running on Windows 7 even if it's running on XP? I'm looking for some kind of theme I can just paste in. I'm aware of the themes project on Codeplex ( http://www.codeplex.com/wpfthemes ), but it lacks support for DataGrid , which is something I critically need. I was thinking maybe the Windows 7 theme would just be an easy port, or exists in some file somewhere already. Any information you have (even if it's bad news) would be much appreciated. Update Using @Lars Truijens idea, I was able to get the Windows 7 look for the major controls, but