datagrid

Silverlight add datagrid column with usercontrol using xamlreader

Hi! I try to add a column to my datagrid using the follwing code, but I'll get an browser crash (can't see a exception). I've added a sample project here: http://cid-5d0909fd6cd506a0.skydrive.live.com/self.aspx/Offentlig/DependencyPropblem.zip The code is as follow: private void LoadDynamicDataColumnTemplate() { string x...

How to do get this CRUD code to work on WPF DataGrid?

I'm writing CRUD code for the WPF Datagrid. In the TheDataGrid_CellEditEnding method below: how do I get the original text before the user made the change? I need the original text to be able to change the customer and save it back to the database with _db.SubmitChanges() Here's the full solution with database if anyone wants to exp...

Displaying a multi-valued column using a tabular UI

I'm hoping to display a multi-valued column in a tabular UI format. By multi-valued column, I mean a column in which a single cell can simultaneously have multiple values -- aka a list of values. These values might be drawn from a short list of possibilities (e.g. an enumeration) or from a long list (e.g. another table). Imagine a tab...

WPF DataGrid - Setting RowDetails programmatically

I'm using the WPF DataGrid, and I'd like to know if there is any way I can access the DataGridRow's RowDetails programatically. For example, when the user selects the row, I'd to grab some data from somewhere (say, a database), and display it in the RowDetails. All of the examples I've seen tend to just display some extra bound data t...

What is the "pressed the delete key" event for the WPF Datagrid?

I want to enable the user to highlight a row on the WPF DataGrid and press delete key to delete the row. the functionality is already built into the UI of the grid, so to the user, the row disappears I currently handle this on the SelectionChanged event (code below) I loop through all the "e.RemovedItems" and delete them with LINQ Pr...

How can I allow user to sort columns on a LINQ-to-SQL WPF Datagrid?

I have successfully set up a WPF Datagrid with the March 2009 WPF Toolkit, created LINQ-to-SQL classes from the Northwind database, bound the WPF grid with this code: var customers = from c in _db.Customers select c; TheDataGrid.ItemsSource = customers; I can move columns from left to right, got delete columns to work...

Sort a DataGrid by clicking on column headers in the Compact Framework?

Just as the title says, is this even possible in the .Net Compact Framework? There's all sorts of stuff it leaves out when comparing with the Desktop Framework. I'm wondering if the Compact Framework's got the upper hand on me with this feature request in our mobile app. ...

DataGrid Paging

Hi, I am using VB.Net 2005, with IE7. I have a datagrid where I have set paging "AllowPaging" = True However, when I click the link to the next page, the records are still the same. My code is: ds = SQLHelper.ExecuteDataset(strConn, CommandType.StoredProcedure, "GetInventory") dv = ds.Tables(0).DefaultView dgInvestoryList.DataSo...

Array binding Xaml by Position (Silverlight) - on Datagrid

Hi, I have a list of string array as input. The array dimension are static for all the list but I can't know the array size until the list is retrieved. I need to bind the list in a datagrid in Silverlight. I tryied to create columns at runtime, binding each column to a particular array position but cannot find a way. Have you any ...

Best way to set the selection of a flex control that hasn't initialized yet

To illustrate the Q. I'll really over-simplify the example (in reality the code is much more convoluted). Say you have a flex control, which underneath contains a datagrid. Something like <mx:DataGrid id="grid" dataProvider="{document.items}"> <mx:columns> <mx:DataGridColumn headerText="Column 1" dataField="@name"/> <mx:D...

Displaying a dynamic data structure in Silverlight DataGrid

I have a data structure like this: MyDataStructure{ string Name{get;set} string Title{get;set;} IDictionary<string, bool> Values{get;set;} } I want to display items from an array of this structure in a data grid type of display Name | Title | {Values[0].Name} | {Values[1].Name} | ... | {Values[N].Name} Any suggestions? ...

Why won't this change the color of my WPF Datagrid headers?

I fill my datagrid in code behind like this: var customers = from c in _db.Customers select c; TheDataGrid.ItemsSource = customers.ToList(); In my XAML below, the DataGrid.RowBackground works but the DataGridHeaderBorder gets the error "The Items listing must be empty before the use of ItemsSource" in the code-behind u...

Can not add rows to WPF DataGrid in PowerShell

I am using DataGrid from "WPF Toolkit" from PowerShell. The problem is that I can't add new rows using GUI. dialog.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:dg="clr-namespace:Micro...

Changing the style of Individual cells in a datagridview row

Is it possible to give individual cells in a data grid view row different styles such as backcolor, fontcolor etc? I do not mean giving the whole row a new style, only a specific cell. ...

PowerShell WPF DataGrid: Exception thrown commiting emtpy row

I get exception trying to commit empty DataGrid row. System.NullReferenceException: Object reference not set to an instance of an object. at MS.Internal.Data.PropertyPathWorker.DetermineWhetherDBNullIsValid() at MS.Internal.Data.PropertyPathWorker.get_IsDBNullValidForUpdate() at MS.Internal.Data.ClrBindingWorker.get_IsDBNullVal...

Windows Mobile datagrid

I am developing a Windows mobile application. How can I show only two columns of the twelve in my datatable in the grid?. Also, is it possible to delete rows in the Windows Mobile datagrid? Please provide sample code. Hi StartClass0830, Thanks for your reply, i don't want remove the columns in my grid, Let's say In ...

Windows mobile datagrid certain fields only displayed and delete rows

Let's say In the windows mobile application i select all the fields of a table from database and i want to display certain fields in datagrid after i want delete certain rows only. Can anyone tell me how to do it? plz provide sample code Thanks brite ...

How can I calculate a grand total in a Windows Mobile datagrid?

How can I calculate a grand total in a Windows Mobile datagrid? For example: ItemID Price qty total 1 5 2 10 2 3 3 9 -------- 19 ------- ...

WPF Datagrid Performance

I am working with the WPF Toolkit data grid and it is scrolling extremely slow at the moment. The grid has 84 columns and 805 rows. (Including 3 fixed columns and the header is fixed.) Scrolling both horizontally and vertically is extremely slow. Virtualization is turned on and I have enabled column virtualization and row virtualizati...

What would the data grid of your dream look like?

Supposing that you already have a basic data grid with all the standard features already implemented and that you can ask for a new feature to be implemented. What would it be? ...