datagrid

WPF DataGrid inside Accordion height issue

≯℡__Kan透↙ 提交于 2019-12-23 09:33:03
问题 I am using the latest WPF Toolkit but am running into a height issue when I have a large record set bound into a DataGrid inside an AccordionItem item. The height of the Accordion itself scales nicely but the DataGrid inside the accordion control doesn't get get a ScrollBar or get constrained in any way so the records are hidden. I know that I am most probably missing something very simple (like a binding from the DataGrid 's height property to the Accordion but that seems messy) here is a

WPF DataGrid is adding extra “ghost” row

最后都变了- 提交于 2019-12-23 09:20:26
问题 Hei, In my application i'm using DataGrid to show some data. To get everything working with threading i'm using AsyncObservableCollection as DataContext of DataGrid. When my application starts it looks for files in some folders and updates AsyncObservableCollection . Finding files is done on a separate thread: Task.Factory.StartNew(() => _cardType.InitAllOrdersCollection()) .ContinueWith((t) => ThrowEvent(), TaskContinuationOptions.None); Where all the loading logic is in

Implementing a hyperlink within a dojo datagrid

亡梦爱人 提交于 2019-12-23 09:20:06
问题 This is my first time working with datagrids so please forgive anything that is unclear. I have json text that is being implemented in a dojo datagrid (dojox.grid.DataGrid). var jsonStore = new dojo.data.ItemFileWriteStore({ url: "xAgent.xsp"}); var layout = [ {cells:[ [ {field:'firstname', name:'First'}, {field:'lastname', name:'Last'}, {field:'policy', name:'Policy'}, {field:'lastaccessed', name:'Last Accessed'} ] ], noscroll:false } ]; grid = new dojox.grid.DataGrid({ store: jsonStore,

WPF datagrid combobox column: how to manage event of selection changed?

前提是你 提交于 2019-12-23 08:30:09
问题 I have a datagrid, with a combobox column <DataGridComboBoxColumn x:Name="DataGridComboBoxColumnBracketType" Width="70" Header="Tipo di staffa" SelectedValueBinding="{Binding type, UpdateSourceTrigger=PropertyChanged}"> </DataGridComboBoxColumn> I want an event that is fired only when the user changes the value into the combobox. How can I resolve this? 回答1: I found a solution to this on CodePlex. Here it is, with some modifications: <DataGridComboBoxColumn x:Name="Whatever">

Check if an event already exists

跟風遠走 提交于 2019-12-23 08:05:17
问题 I have a data grid loading row event _gridObj.LoadingRow += new EventHandler<DataGridRowEventArgs>(_gridObj_LoadingRow); and in the handler I am creating another event. In the following code how can I know if the MouseLeftBtn event already exists for that row? void _gridObj_LoadingRow(object sender, DataGridRowEventArgs e) { e.Row.MouseLeftButtonUp += new MouseButtonEventHandler(Row_MouseLeftButtonUp); } Thanks, Voodoo 回答1: Based on your comment that you don't want to attach muliple handlers

Freezing columns in wpf datagrid

…衆ロ難τιáo~ 提交于 2019-12-23 06:49:31
问题 I have some tabular data which has a lot of fields in it, and when my WPF application is resized a lot of them are cut off. However, I want to see the first 6 columns always as they are important. How can I achieve this in a grid format? I am using the WPFToolkit DataGrid but can be persuaded to change to a different control if one exists. Right now, I am using two different DataGrids side by side with the right most datagrid inside a scrollviewer with horizontal scrolling on and the vertical

how to set a comboBox's style inside a WPF DataGrid?

此生再无相见时 提交于 2019-12-23 05:51:28
问题 I have a DataGrid containing some DataGridComboBoxColumns. I would like the comboBoxes inside those columns to have a certain style applied. so I tried adding the following to my DataGrid's Resources: <Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer

DataGridComboBoxColumn not updating model WPF

孤街醉人 提交于 2019-12-23 05:33:11
问题 I'm using Datagrid in WPF and DataGridComboBoxColumn. Please find the code below: <DataGrid>... <DataGridComboBoxColumn Header="Category" Width="200" SelectedValueBinding="{Binding SelectedCategory, UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="CategoryName" SelectedValuePath="CategoryID"> <DataGridComboBoxColumn.ElementStyle> <Style TargetType="ComboBox"> <Setter Property="ItemsSource" Value="{Binding CategoriesList}"></Setter> </Style> </DataGridComboBoxColumn.ElementStyle>

WPF MVVM Validation DataGrid and disable CommandButton

心不动则不痛 提交于 2019-12-23 05:22:57
问题 I have created a sample MVVM application attached. I use a datagrid I have a button bound to a command I have a some custom validation rules applied to certain cells and a textbox. What I want to achieve is: I like validating while typing (this is already working with validation rules and UpdateSourceTrigger=PropertyChanged). I'd like to validate single cells/rows (this is already working, too) I'd like to do "form" validation. E.g. Cross-row validation to validate that no duplicate strings

Silverlight DataGrid - Binding to a Collection of Collections of objects

我与影子孤独终老i 提交于 2019-12-23 05:16:05
问题 Problem: The data I'm trying to display is essentially a collection of collections of some object. So the rows can be any number, normal for a datagrid, and the columns are also any number. That's not so normal for a datagrid. Usually you have a set number of columns and your rows vary. The datagrid cell will be either a string or a value changeable via a combobox. Attempted Solution: I tried adding columns to the datagrid dynamically, and while this worked just fine (adding them in