datagrid

WPF DataGridView format cell on error

I have a DataGrid wich is bound to a DataTable.DefaultView. And now what i need additonaly: I did set the ColumnError Information of the DataGridRow. So for every row in my table i have column errors and i want to display this columns with red textcolour. So the user can see this column had an error. How can i set the cell color depen...

Silverlight DataGrid makes the first selection when ItemsSource is Set, how can turn this off?

Hi Guys, I am using Silverlight 4 DataGrid with DataPager. When the DataGrid's ItemsSource is set, it selects the first row in the list. PagedCollectionView _list = new PagedCollectionView(myDataCollection); _dataPager.Source = _list; _dataGrid.ItemsSource = _list; The problem is that I have _dataGrid.SelectionChanged event, which ...

How can I store custom object in WPF DataGrid cell?

Hello. How can I store custom object in WPF DataGrid cell? For example, I want to store something like this: http://yfrog.com/0583557380j. I have no ideas :(. Thanks. ...

wpf datagrid - binding a custom column

I have a datagrid with 4 columns. Build Defintion, command, arguments, and a delete button. I am building a ObservableCollection of a class called monitor which is the dynamicresource for the datagrid. The monitor contains the build definition, command, and arguments. All are string types. The command and arguments are simple as they are...

WPF DataGrid with SelectionUnit=FullRow allows nagivation within the row. How to disable?

I configure the DataGrid <DataGrid SelectionMode="Single" SelectionUnit="FullRow" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" IsReadOnly="True" > When it's shown, full row does get highlighted and has a cell with selection border. User can press...

Trouble finding DataGrid to implement for over 10,000 records with pagination, filtering, and clickable links for each row.

I have tried using a few different data grids (FlexiGrid, ExtJs Grid, and YUI DataGrid) and have found YUI to work the best as far as documentation and features available. However, I am having difficulty setting up the data source. When I try to set it up using JSON, it takes too long, or times out. I have already maxed out the memory ...

XamlParseException occurred: Failed to create a 'System.Windows.Style' from the text 'PhoneMasterGridColumnHeader'.

I have four datagrids on a Silverlight 4 page. I'm trying to set different column header styles for each grid. I found this XAML which works when I embed it in each DataGrid inside <sdk:DataGrid.ColumnHeaderStyle> tags: <Style TargetType="primitives:DataGridColumnHeader" > <Setter Property="Template"> <Setter.Value> ...

How to set values into custom DataGridBound column in WPF

Since there is no way to paste values into a DataGridTemplateColumn. I found some suggestions for creating my own column class derived from DataGridBoundColumn. The sample below adds a DatePicker to the column without using a template. However this sample does not allow me to manually set a value using the DatePicker and I'm not sure wh...

wpf sorted datagrid get selected cells

hello, how can i get the selected rows - and then each (visible) cell separately on a sorted datagrid? something like datagrid.SelectedCells[i][j], but with sorting taken onto account. Thanks ...

Binding to DataGridTemplateColumn

hi, I have a User table and I have a foreign key of this table from a Book table. the FK is ProxyResponsibleUser_ID. when I use DataGridTextColumn in my DataGrid anything is OK but now I want to use DataGridTemplateColumn to display the FullName column from User table for corresponding user with ProxyResponsibleUser_ID. I get an error s...

Update DataGrid bound to DataTable after DataTable is altered WPF

I have a combobox where the user can select a particular year (populated by the database) and view particular information for the year. That information is stored in a datatable which is bound to a datagrid. I want it to recreate the data grid when I change the year. _PropertyTenantData is a DataTable that has 14 columns Property Id, Pr...

Why does this function take more time in Firefox

In my grid I want to set 3 buttons allowing the user to choose the cols to view So I wrote this function; it's fast on chrome and safari, but it takes a lot of time on Firefox. Where is the problem? Is there another way to do this? function showHideCols(dcols){ thisGrid = Ext.getCmp('myGrid') thisColModel = th...

binding a datagrid to nested collections within collection

I'm trying to bind a datagrid to data from within a collection of a collection of the datacontext. The result should be as though all of the nested collections were just one collection with the parent collection properties still available. For example I have a series of products associated to an order and each product can have multipl...

flex 3 : sorting date column in datagrid

How to sort date column in datagrid with date format of 'DD/MM/YY'. please give me sample. Thanks in advance ...

Changing data in datatable and it does not show in Grid

Hi I have a table adapter on a dataset which is linked to a datagrid with a binding source. Now i have a column in my grid that is a checkbox which if clicked i change a value of another column in the grid. So i do it on the cellvaluechanging event of the gridview and then I get the focused datarow in the datatable and change the oth...

Binding a cell object's property to a DataGridCell in WPF DataGrid

Using the WPF DataGrid I have the need to change various display and related properties of a DataGridCell - such as Foreground, FontStyle, IsEnabled and so on - based on the relevant value of the cell object property. Now this is easy to do in code, for example (using an Observable Collection of ObservableDictionaries): var b = new...

How To Prevent WPF DataGrid From De-Selecting SelectedItem When Items Updated?

My scenario: I have a background thread that polls for changes and periodically updates a WPF DataGrid's ObservableCollection (MVVM-style). The user can click on a row in the DataGrid and bring up the "details" of that row in an adjacent UserControl on the same main view. When the background thread has updates, it cycles through the ob...

In WPF, how can I bind a datagrid column to a specific column of a datatable?

I have a Datatable with many columns, and a datagrid in which I need to display only a few of those columns. I need a codesample of how to do it. I found a whole bunch of examples telling me to turn AutoGenerateColumns to true and set the table as DataContext to display all the columns in my DataTable. And I guess I could then put in a p...

wpf datagrid - sourcecollection count is 0 newitemplaceholder is not shown

After deleteing all the items in the bound collection, the datagrid.items.count is 1 and the only item in the item collection is newitemplaceholder but the datagrid does not show the newitemplaceholder. This can only occur if the last item is the newitemplaceholder and you attempt to edit it but instead of hitting enter you click the but...

Binding WPF datagrid to 2 dimensional array

I have a datagrid and want to bind it to a 2 dimensional array and reflect changes in the array to ui automatically (using observable collection for example). However, I am stuck now because datagrid.itemssource = array gives me "'The invocation of the constructor on type 'WpfApplication1.MainWindow' that matches the specified binding co...