wpfdatagrid

How to Disable Tab functionality inside a grid in WPF

Hi, My requirement is rather a tricky one (it seems to me). I will explain the scenario. I have a DataGrid. In the DataGrid, I have two columns in which I have a grid in every cell of these two columns, inside of which, there are two comboboxes - the purpose being to switch the visibility based on some conditions. When we select a val...

Checkbox gets reset in WPF Datagrid when sorting

I have a WPF application with DataGrid The DataGrid contains 4 columns with a checkbox template column on the first column the problem is when i check some of the checkbox on the items, the checkbox would got reset when i sort a certain column. For example i check the checkbox on the row 2 it gets unchecked when i sort the datagrid. be...

DataGrid - how to make Column sorting dynamic, to cater for when bound data changes?

I'm using a DataGrid in a VS2010 WPF C# project. I have bound the DataGrid to an ObservableCollection. When you click on a column heading it sorts the data at that point in time. Question - How would I arrange such that the sorting in the DataGrid is dynamic, so that when data changes (within the ObservableCollection) the sorting keep...

WPF DataGrid Styling Triggers

Hi, I am writing a simple WPF application to display log file data. I have successfully databound to my events collection, and used various style triggers to style the grid (different background colours for different event types etc). I now wish to add buttons to show/hide different event types (warning, error, information, etc). I can...

WPF - DataTemplate question

Hi, I datatemplate a grid header with a button. When the button is clicked, I want to send the uid (which is a property of the grid column(parent)) as the command parameter. I Tried : 1. Template Binding 2. Relative Source 3. ElementName (doesnt accpet Binding) But nothing seems to work. Any clue, how to bind to a parent's property in...

Which WPF datagrid to choose

Hi We are selling an ERP solution which is up to now completely written in VB6 We are planning to go to WPF in the near future. Due to our migration strategy we will not do the migration as a whole but in more than one step. This implies that we want to keep as much of our business code as possible, which means that the new UI elements ...

WPF - Binding StringFormatting Not Working

Hi, I need to append a simple string to my commandparameter but doesnt work. Does StringFormat support this or am I doing anything wrong ? <DataTemplate x:Key="ClickableHeaderTemplate"> <Button x:Name="btn" Content="{Binding}" Background="Transparent" Command="{Binding DrilldownHeaderClicked}" ...

WPF datagrid selected row background gradient

Hi I am trying to style a DataGrid, and would like the selected rows to have a radial gradient as background. But instead of the radial to cover the whole of the selected row, the gradient is just repeated for each cell. Lets say my radial brush looks like a sundown I would like one sundown per selected row, not per cell in the selected ...

Text highlighting inside a WPF toolkit DataGrid

I wanted to know if it is possible to highlight text inside a WPF toolkit datagrid. My aim is to mimic the ctrl+f find functionality of internet explorer inside a DataGrid. With each click of find, the next instance of the searched keyword should be highlighted. This is the best I have seen on the net. http://blogs.microsoft.co.il/blogs...

Code to fetch data from excel in WPF window

hi I want to develop C#.NET base WPF application ,in which I want to fetch data from excel file included in same project as well as manipulate through this data in WPF window. ...

WPF DataBinding Error: I have no idea how I'm getting this error.

I get the following errors from the code below... not sure why (and yes, it produces all 4 even though it's the same 2 repeated). Oh, and it doesn't produce the alternating rows effect, even though prior to these errors popping up the same code was working. System.Windows.Data Error: 4 : Cannot find source for binding with reference 'Re...

How to add paging to a wpd 4.0 datagrid?

How can I do this? Many thanks. ...

WPF Datagrid Row Editing "ENDED" event

I know that WPF datagrid has "RowEditEnding" event , but I need to fire the event on after the Row has comitted to check if the newly added row is duplicated and merge the duplicated row. My datagrid has "CanUserAddRow" property set to True. I am using EntityObservableCollection that extends ObservableCollection to synchronize my entity...

DataGrid's CellEditingTemplate and focus in edit mode

I am having an issue with WPFToolkit DataGrid when a column is customized supplying both CellTemplate and CellEditingTemplate. If you take a look below, you will see my editing template has a single CheckBox. All is fine in a functional sense but when F2 is hit to edit the cell, one must also hit TAB in order for the CheckBox to receive ...

I changed the SelectedItem via a Binding. Now how do I move it into view without code-behind?

I've got a DataGrid with a Two-Way Binding on SelectedItem. I can change the SelectedItem in my ViewModel, but the DataGrid won't ScrollIntoView automatically. Is there a way to do this without using a code-behind event handler that calls ScrollIntoView(SelectedItem), or should I just give in and use a little code-behind? ...

WPF TabControl rebinding everytime

Hi, I am data templating a tab control. Each time I select a tab, the binding of the contents get applied. So for eg, if I have a tree view expanded in tab1 and going to tab2 and coming back has this collapsed. The property binded to ItemsSource is invoked each time I flip the tabs. learned its all because the visual tree gets recreate...

Binding multifunctional WPF DataGrid

How would you go about binding a WPF datagrid that needs to display data from many different datasources with varying number of columns with different column headers and types? What I'm currently doing is creating a custom List<DataGridColumn>() list of datagrid columns in my ViewModel for each different collection of records to be disp...

Is it possible to create sub-headers in a WPF DataGrid?

For example, say I am maintaining an inventory of the different produce my friends have and want the following table: | People | Fruit | Vegetables | | | Apple | Orange | Berry | Carrot | Lettuce | | Adam | x | | x | x | | | Bob | x | x | | | ...

WPF DataGrid Get Cell Value while user is typing

I have a WPF DataGrid and i want to show a completion list below the cell currently being edited. I cannot seem to find a way to get the uncommitted value. I tryed catching all key down events but cannot find where the value is stored until it is committed. ...