wpfdatagrid

WPF: DataGrid Row Validation isn't be fired when a DataGridComboBoxColumn is changed

When I correct errors the red box around the cell disappears but the "!" mark indicating row validation errors doesn't go away. This only seems to occur with a DataGridComboBoxColumn, text columns work correctly. What could be causing this? ...

WPF DataGrid - How do I use cell and row validation with DataGridTemplateColumn

How do I use cell and row validation with DataGridTemplateColumn? <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding DataType}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> ...

WPF: What could cause a DataGrid to call IEditableObject.BeginEdit/EndEdit but never IEditableObject.CancelEdit

When I start editing my grid IEditableObject.BeginEdit. And if I leave then IEditableObject.EndEdit is called. However, if I press Escape then IEditableObject.CancelEdit doesn't get called. This was working before, so I'm not sure what I did to break it. Or even what can break it. ...

How to write a Rename Logic(Like folder rename in windows) in C# for WPF Application

I am making a WPF Application where in i have a datagrid inside a treeview. Now....When i right-click on an item in this grid, i get a context menu with a Rename option. On this, I need to write a Rename logic. I want to do just like we rename folders in windows. How can i go about it? Please give me a simple solution as I am not a pro l...

Changes to the DataGrid from v. 3.5sp1 (ToolKit) to .Net 4.0

I recently discovered that some functionality has been changed drastically in the DataGrid since it made it into the general 4.0 framework (Using BindingGroups for one). Can anyone point me at a list of changes (breaking or non-breaking)? ...

DataGrid how to get the value of the CurrentCell

I have to access the value that underlies the active cell of a DataGrid (The cell with the black border around it). Luckily DataGrid has a lot of properties such as CurrentCell, CurrentItem SelectedCells SelectedItem and SelectedItems seeming to provide me with the data I want. However I have not figured out how to access the cell in ...

Resize column header in listview wpf

How can set "AllowUserToResizeRows" property in Header listview wpf? it was in Windows.Forms thus :" dataGridView.AllowUserToResizeRows = false " My xaml code is : <ListView Margin="2.5,0,0,32" Name="listView1" ItemContainerStyle="{StaticResource myItemStyle}" SelectionMode="Single" HorizontalContentAlignment="Center" VerticalAlignmen...

How to determine whether a WPF DataGrid is in edit mode?

Is there a way to determine whether a WPF DataGrid is in edit mode / which row is currently edited? EDIT Duplicate: http://stackoverflow.com/questions/3248023/code-to-check-if-a-cell-of-a-datagrid-is-currently-edited ...

WPF DataGrid with XmlDataProvider simple example

After a few hours trying to reach some working sample i decided to try my luck here. I am a newbie to WPF, but things should get easier with time ... I am trying to have a DataGrid showing an XML file i have. That's it. I have in my application cars.xml <cars> <car type="Ford" size="4" /> <car type="Mercedes" size="2" /> ...

WPFToolkit DataGrid/Listview column Traversing?

Any hands on example for implmenting the Traversing of the DataGrid/Listview colum element if the column has a DataTemplate applied with TextBox?. ...

How do I make mutually exclusive columns in a WPF Data Grid?

Here's my current problem: I have a data grid with 4 columns in it: Year One by Index, Year One by Percentage, Year Two+ by Index, and Year Two+ by Percentage. I want my data grid to make these columns mutually exclusive with its counterpart column. So for example, if I type in a number for Year One by Percentage I shouldn't be allowed...

WPF: Databinding with DataGridComboBoxColumn

This is what I want: There is a combo-box column bound to the ApplicationKey property of ClassA The combo-box is populated with ApplicationTokens from a static function all. An ApplicationToken has a ApplicationName and ApplicationKey property When an item is selected in the drop-down, the ClassA.ApplicationKey property is set to the A...

WPF: "None" option when Databinding with DataGridComboBoxColumn

This is what I want: There is a combo-box column bound to the ApplicationKey property of ClassA. ClassA.ApplicationKey is a Nullable<Int32> The combo-box is populated with ApplicationTokens from a static function all. An ApplicationToken has a ApplicationName and ApplicationKey property When an item is selected in the drop-down, the Cl...

WPF: Command bindings for Buttons in datagrids

In this sample I have two buttons. The button in the header works, but the one in the grid gives me the error show below. <GroupBox DockPanel.Dock="Top" > <GroupBox.Header> <StackPanel Orientation="Horizontal"> <Label Content="Recent Servers" /> <CheckBox Content="Auto-Refresh" /> <Button ...

Unable to perform Up-down operation when wpf datagrid is sorted

HI, I have a datagrid (from wpf toolkit) which is binded to an observable collection . There are two buttons "Up" and "Down" which moves the selected row accordingly. For eg: If there are 10 items in the datagrid and if I select the 4th item and press "Up" arrow ,then the 4th item will be moved to 3rd item and previous 3rd item will b...

WPF 2-Way Databound DataGrid

Can anyone point me to a very simple example(C#4.0) of a WPF Datagrid thats bound to a SQL table. I'd really like the simplist example possible. I want to be able to add, edit and delete rows. Thanks. ...

WPF4 DataGridHeaderBorder in a xaml Style

Making a separate question, related to comments on the answer to http://stackoverflow.com/questions/2481946/wpf-4-what-happened-to-datagridcolumnheader It appears I can use DataGridHeaderBorder in a UserControl, stand-alone in a ResourceDictionary, but not in a Style's setter of a Template. <ResourceDictionary xmlns="http://schemas.mic...

WPF Datagrid group expander text - how to bind ??

I am using a datagrid with a combox that should change the grouping field. I am using the following xaml to define the general grouping template : <DataGrid.GroupStyle> <GroupStyle> <GroupStyle.ContainerStyle> <Style TargetType="{x:Type GroupItem}"> <Setter Property="Template"> ...

WPF: DataGrid Find and Replace

I'm using a DataGrid to display the values of specific properties of a collection of objects. I've implemented search and cell highlighting through a similar method to the one on Tomer Shamam's blog. However, I now need to implement 'Find/Replace' type functionality. I presumed I would be able to iterate through the DataGrid's cells to ...

how to set focus to particular cell of WPF toolkit datagrid

I am using WPF toolkit provided DataGrid control to display product list along with its OpenStock, Description etc. In this DataGrid i have set OpenStock column to editable and rest are non-editable. What i want now when my this windows loads, I want to set keyboard focus to first cell of OpenStock column and if possible in edit mode. I ...