wpfdatagrid

How to rollback changes to WPF DataGrid control using LINQ-to-SQL?

I was able to set up a WPF Datagrid, display a Northwind database table via linq-to-sql, and handle the TheDataGrid_RowEditEnding event so that it saves back the the database. However, when a CustomerID was changed, it gets an error from the database which I handle, but how do I now either (1) rollback the Datagrid control or (2) refetc...

Click event for DataGridCheckBoxColumn

Hey guys. I have Datagrid in WPF form with DataGridCheckBoxColumn, but I did not find any click, Checked and unchecked for it... Are these event available for DataGridCheckBoxColumn ? If not please suggest some workaround ? Thanks ...

How do I get the header content for a DataGridColumnHeadersPresenter control template?

<dg:DataGridColumnHeadersPresenter> <dg:DataGridColumnHeadersPresenter.Template> <ControlTemplate> <Border> <ContentPresenter ContentSource= ??? /> </Border> </ControlTemplate> </dg:DataGridColumnHeadersPresenter.Template> </dg:DataGridColumnHeadersPresenter> Thanks for yo...

Column with DateTime value in WPFToolkit DataGrid

I am trying to make a simple DateTime column, for setting Time values. Playing around like that: <toolkit:DataGridTextColumn Header="Start" Binding="{Binding Path=StartAt, StringFormat=0:hh:mm:ss tt}"/> it appears normal but changing the value doesn't work out. I dunno why. And is there any possibility to make some kind of "mask", wh...

WPF. Warn about CapsLock

I have a DataGridTemplateColumn with DataTemplate as a PasswordBox. I want to warn user if CapsLock is toggled. private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) { if (Keyboard.GetKeyStates(Key.CapsLock) == KeyStates.Toggled) { ... Now, I need to raise some PopUp here. I don't k...

WPF DataGridTemplateColumn. Am I missing something?

<data:DataGridTemplateColumn Header="Name"> <data:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Name}"> </DataTemplate> </data:DataGridTemplateColumn.CellTemplate> <data:DataGridTemplateColumn.CellEditingTemplate> <DataTempla...

WPF DataGrid how to get when ItemsSource updates

Which event fires when DataGrid's source is updating? I've tried DataContextChanged and SourceUpdated but it never worked out. Actually I need a simple thing. I want, if there is a new row comes, scroll the GridView's scrollbar down to the bottom to see what it was. ...

conditional formatting in wpf toolkit datagrid

hey i wanna change row foreground color according to a boolean in the model, whats the best way of doing it? ...

WPF DataGrid from WPF toolkit vs ListView - any benefits?

I know ListView pretty well, but never looked at DataGrid. My question is simple - if you do not need editing in the list, does DataGid provide any benefits comparing to ListView? Also, are there disadvantages of using DataGrid (more complex, performance, bugs, hard to style, etc...)? ...

WPF DataGrid column widths and reordering

I have a DataGrid defined as <wpftoolkit:DataGrid x:Name="AccountsDataGrid" AutoGenerateColumns="False" ItemsSource="{Binding Path=Accounts}" ColumnReordered="DataGrid_ColumnReordered" SelectionUnit="FullRow" RowHeaderWidth="0" HorizontalAlignment="Stretch" VerticalAlignmen...

WPF DataGrid: Reordering Rows?

I am creating a WPF data grid, and I want to be able to reorder rows by dragging and dropping, like this: I click on a row and drag it up or down. As I do, a marker shows where the row will be dropped if I release the mouse. When I do release the mouse, the dragged row is inserted where indicated by the marker. Has anyone seen any artic...

WPF DataGrid: Making Image column header into a resource?

I have created a checkbox column in a WPF DataGrid, and I have set the column header to be a checkmark image. Here is my markup: <toolkit:DataGridCheckBoxColumn Binding="{Binding Completed}" Width="25" IsReadOnly="false" > <toolkit:DataGridCheckBoxColumn.Header> <Image Source="..\Resources\Images\checkmark.png" Height="9" W...

WPF DataGrid Best Practices?

I am working on an MVVM-based WPF app that uses the DataGrid. The grid is data-bound to an ObservableCollection (the Widget list). The user needs to be able to insert a Widget into the list below the currently-selected Widget, to delete a selected Widget, and to reorder the Widgets on the grid. I'll implement the reordering through dragg...

WPF DataGrid: Blank Row Missing

I am creating a WPF window with a DataGrid, and I want to show the blank "new item" row at the bottom of the grid that allows me to add a new item to the grid. For some reason, the blank row is not shown on the grid on my window. Here is the markup I used to create the DataGrid: <toolkit:DataGrid x:Name="ProjectTasksDataGrid" ...

WPF Datagrid RowDetailsTemplate visibility bound to a property.

Hi, I am using a WPF Datagrid with a RowDetails panel where the RowDetailsVisibilityMode is set to "VisibleWhenSelected" and the SelectionMode="Extended" so that multiple rows can be selected and hence display RowDetails, as below: <dg:DataGrid x:Name="MyGrid" ItemsSource="{Binding Path=MyItems}" AutoGenerateC...

What namespace must be used to get a DataGridComboBoxColumn?

I am writing an app in C# 3.5 in WPF. I want to programmatically add a DataGridComboBoxColumn in C# to a WPF toolkit DataGrid. The problem is that the control itself seems to not exist because I am missing either a directive or an assembly. I thought that System.Windows.Controls and by adding a reference to the WPFToolkit would handle th...

WPF Datagrid "Select All" button - "Unselect All" too?

Hi, I would like to know if it would be possible to add functionality to the 'Select All' button in the top left of a datagrid so that it also unselects all rows? I have a method attached to a button which does this, but it would be great if I could fire this method from the Select All button, to keep functionality in the same part of t...

Can I have only a single row of a WPF DataGrid editable?

I have a data set that I want to display to the user, but I only want them to be able to edit the newest (first) row of data. I need to display the other rows of data to them for reference. I don’t have to keep everything in the same DataGrid but would like to if possible. I’m new to WPF so any help/ideas are greatly appreciated! ...

Style first row in a WPF Datagrid

Hi, I would like to change the styling of the first row (only) in a WPF Datagrid but haven't found how to do it. I wondered about creating a trigger, something like this: <Style TargetType="{x:Type dg:DataGridRow}"> <Style.Triggers> <Trigger Property="SelectedIndex" Value="0"> <Setter Property="Background" Value...

How to reorder WPF Toolkit datagrid colums programmatically?

Hi! My application uses the WPF DataGrid control with custom columns. Although the property Columns is an ObservableCollection<>, the invocation of the method Move does not effect the order of the columns in any way. Can I somehow reorder the columns of a WPF Toolkit DataGrid programmatically? Best Regards Oliver Hanappi ...