datagrid

DataGrid is not obedient to SelectedIndex property set

I need to make the DataGrid, so if I am in edit mode, and the current row is not valid, the user should not be able to select a different row. In fact, I think that the DataGrid is supposed to avoid selection of another row once the CollectionChangingEventArgs of the CollectionView is flagged for cancellation, the DataGrid should stick ...

font color to the silverlightdatgrid cell of particular column while binding

i just want to apply font color to the text of a silverlight datgrid cell for a particular column while binding the itemsource how can that be accomplished? ...

Silverlight binding in a DataGridRowGroupHeader doesn't update when DataSource changes

I have a Binding in a inline style for the DataGridRowGroupHeader like this. <sdk:DataGrid.RowGroupHeaderStyles> <Style TargetType="sdk:DataGridRowGroupHeader"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="sdk:DataGridRowGroupHeader"> <TextBlock Margin...

Find datagrid column name when a cell is clicked in datagrid

Hello All I wanted to find the datagrid column header when a cell is clicked.. i used the following code private void grid1_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { DependencyObject dep = (DependencyObject)e.OriginalSource; while ((dep != null) && !(dep is DataGridColumnHeader)...

How would I create a table control similar to the one shown?

I've got a table from an existing LabView VI (ewww!) that I need to replicate in C#. The table is shown in the image below. Each field will be populated with data returned by status queries to an external device, likely from within a dedicated status thread (when I implement it...). Is there any control, or direction I should take whe...

flex data grid visibility when empty

Hi, I have data grid that measures the height according to the rows it has, but i need to disappear/ make invisible when i have no data, so the header will not just appear alone. ...

reordering silverlight datgrid column

i was just reordering the columns of a silverlight datagrid in xaml.cs in the event grid_autogenerating.i used the follwing code but stil it doesn't works out. i was using void grid_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e) { switch (e.Column.Header.ToString()) {...

Silverlight Datagrid: Highlight an entire column when that column is sorted

I have a DataGrid in my Silverlight application that I would like to highlight an entire column when that column is sorted. It's similar in concept to this previous question: Silverlight DataGrid: Highlight an entire column. Any ideas? I've thought maybe attaching a behavior to the LayoutUpdated event and checking a cell to see if it's...

What to use for a datagrid with a lot of data?

Hi, Found this interesting interview question: You need to display the sales data for your division for the past 5 years in a DataGrid on a Web Form. Performance is very important. What would be the best strategy to use in retrieving the data? a)Use a DataReader object to retrieve the data for the DataGrid. b)Use a DataSet object to ...

Different sized vertical cell widths in a WPF Datagrid control

I have a collection of Person objects that I want to display in a WPF Datagrid. The class definition for Person is: class Person { string Name; int Age; List<string> FavoriteFoods; } I want to display a collection of Persons in a table. Because a person can have multiple favorite foods, I want all those favorite foods in a singl...

How to use a List(Of T) as Itemssource for a WPF DataGrid?

I wanted to quickly display a List(OF String) in a DataGrid (dynamically), so I thought myDataGrid.ItemsSource = myList would be the quick and easy way to do it, since this works great for a DataTable: myDataGrid.ItemsSource = myDataTable.DefaultView My DataGrid has the AutoGenerateColumns property set to 'True'. And for the datat...

Flex 3.5a - Using a programmatic skin as the VerticalSeparatorSkin for a DataGrid

Hi there, I am trying to create a dotted line (1 pixel width, 1 pixel black/3 blank alternating along the line) as the vertical separator in a datagrid. I understand that you can use a ProgrammaticSkin to create skins for Flex, but I can't seem to get it to display the line I create. Here is my skin at the moment: package mypackage.sk...

Keep selection when refreshing datagrid in ActionScript

I'm working on my first ever AIR application with flashbuilder - just so you know. I've bound a mx:DataGrid component to a DataProvider which is a mx:HTTPService fetching an xml file with items. To keep the data up to data I'm polling the webservice on a given interval. My problem is that I loose the currently selected item in my DataG...

Silverlight Multiple Row Validation in Datagrid

Hi, There are two requirements 1) Validate row data before saving the record 2) Show Server side errors or business rule failure Now the only issue is how to put error mark and make that row red in silverlight for multiple row. most of the example available on net is for single row ...

WPF Datagrid - Set Column visibility per row

Is there any way to hide a given column based on a binding. I've tried setting the visibility property on DataGridTextColumn (using the correct converter), but that doesn't seem to work. If I set the value directly (not through binding) it works. So is column visibility an all or nothing deal with the datagrid? ...

DataGrid row content vertical alignment

Hi, I have a regular DataGrid from WPF 4.0 RTM, where I put data from database. In order to make clean & light style of DataGrid I use a tall/high rows and by default DataGrid aligns row content in top vertical position, but I want to set a center vertical alignment. I already tried to use this property VerticalAlignment="Center" i...

programmatically binding images to silverlight grid cell based on condition

how can i programmatically binding images to silverlight datagrid cell of a particular column based on the datasource values ...

WPF - Binding multiple values to a datagrind

UPDATED : Clean subject, and summarize it. Hi, I've a datable filled, where each cell is a class like this class CValue{ public object Value; public Brush Quality; private int m_quality; public override String toString(){ return Value.toString(); } } My datagrid is bind on the datable, and it's wo...

Silverlight 3 : Datagrid - Editing a cell shows a "Property set method not found." message

Hi All, I have a silverlight datagrid control bound to a Dictionary<string, string> with autogenerate columns set to true. In the AutoGeneratingColumn event i change the column Header and IsReadOnly Properties as required(column bound to dictionary value is editable). if ( string.Compare( e.Column.Header.ToString( ).ToLower( ), "key"...

How to check if a scroll is currently visible in WPF DataGrid?

How to check if a scroll (vertical or horizontal) is currently shown in WPF DataGrid? HorizontalScrollBarVisibility and VerticalScrollBarVisibility are used to set the behaviour and they are set to Auto. ...