wpfdatagrid

How to add Button to WPF Datagrid column dynamically ?

Hi .. Is there any way to dynamically add a button control(along with column name) to WPFDataGrid column,?? By clicking on header button,pop-up will open . this button generation is dynamic one ,which will be decided from code-behind, for some column headers need to add,for some not needed to add. ...

Programatically add ValidationRules to WPF DataGrid when autogenerating columns

I want to do this in the AutoGeneratingColumn event: <my:DataGridTextColumn Header="CompanyName"> <my:DataGridTextColumn.Binding> <Binding Path="CompanyName"> <Binding.ValidationRules> <local:DataRowValidation ValidationStep="UpdatedValue" /> </Binding.ValidationRules> </Bindin...

WPF Datagrid. Get the values of each cell of the selected row.

I'm using the WPF toolkit datagrid. How can I get the values of the cells of the selected rows? Thanks ...

Enabling Paging in Infragistics Grid for WPF

Hi I'm using the latest version of infragistics DataGrid (9.2). Unfortunately, Paging is not supported out of the box. I wish to implement this behavior by myself. I refer to paging as the ability to give the grid an illusion of many results and fetch for it the necessary items depends on the view as it is needed. the reason for me ...

Difference Between Value attribute and explicit DataTrigger.Value in ResourceDictionary?

Can anyone tell me why the following doesn't work, but the one after it does? Notice the Value= syntax versus the explicit usage on the latter. I don't understand the difference. <Style.Triggers> <DataTrigger Binding="{Binding ItemType}" Value="{x:Type log:FranchiseAiring}"> <Setter Property="Template" Value="{StaticResource...

WPF DataGrid update issue

Hi all, I am facing a scenario here. I have a main class which initializes a DataGrid added in MainWindow of wpf application. There is a thread class in which DataTable object is passed by ref and that thread is responsible for updating the DataTable. As the thread runs the DataTable gets updated but but the view does not get updated. ...

Use s checkboxcolumn if row of datagrid needs to be selectable

I use a datagrid with a checkboxcolumn in c# 4.0. I right now I need 2 clicks to change the state of a checkbox if I enable row selection. One click selects the row and the second changes the state of the checkbox. How can I enable row selection, but keep the 1 click for changing the state of the checkboxcolumn? <DataGrid Auto...

WPF Datagrid, Setting the background of combox popup

Hi, I would like to change the color of the popup background when using a DatagridComboboxColumn in the WPF Toolkit datagrid. I've edited the Template for a normal Combobox and it works great for selected item and other properties but the background stays white. I've used Snoop to do some research into the template and it claims that the...

WPF DataGrid style Silverlight DataGrid?

That's not a secret: Silverlight's DataGrid default style is beautiful while WPF's is poor. Instead of reinventing the wheel let me ask the community if anyone has copied the SL styles to use in WPF. Silverlight default-style DataGrid: WPF default-style DataGrid (updated after Saied K's answer): ...

DataGridTextColumn.MaxLength?

How do I set the MaxLength property of the DataGridTextColumn? ...

How to use WPF Toolkit Datagrid DataGridTemplateColumn and a combobox?

I have a data grid that looks like this <tk:DataGrid ItemsSource="{Binding Parents}" AutoGenerateColumns="False"> <tk:DataGrid.Columns> <tk:DataGridTextColumn Header="Description" Binding="{Binding ID}" /> <tk:DataGridTemplateColumn Header="Description" > <tk:DataGri...

Binding to a complex object in Silverlight

i know it must something simple that i missed. I use data services to get data into my silverlight application. When i bind the data to my datagrid it works like a charm LessonGrid.ItemsSource = context.Lessons however as soon as i try to wrap my objects into more complex data structure it stops working LessonGrid.ItemsSource = conte...

WPF datagrid sort direction

How can I see the sort button & direction per column in my datagrid? Or even better, how can I see a seperator between the column headers? here's my grid code: <Window.Resources> <Style x:Key="HeaderTextStyle" TargetType="{x:Type dg:DataGridColumnHeader}"> <Setter Property="Background" Value="DarkSlateGray" /> <Set...

different image as tooltip for different rows in a datagrid in wpf

I am doing something in wpf where in a datagrid is populated. I need that for each row in the datagrid, when i point my mouse, a tooltip should be visible containing an image. And this image will be different for each row of the datagrid. How do i go about it. I have been able to do this: Image img = new Image(); BitmapImage bmp...

Multilevel GridView in WPF

I have been trying to search frantically for Nesting GridViews(4 levels). I have used Rowdetailstemplate for 2 levels for a different view but not beyond it. Many articles have gridview inside a TreeView which is ok but I need my inner elements to have headers too. Something like this(http://www.codeproject.com/KB/webforms/MasterDetail.a...

MvvmLight EventToCommand and WPFToolkit DataGrid double-click

Trying to figure out how to use EventToCommand to set a datagrid double click handler for rows. The command lives in the viewmodel for each row. Just that much out of my experience, since I haven't used interactions yet. Thanks. I would have used mvvmlight tag, but I don't have high enough rep yet to make new tags. ...

Freezing columns in wpf datagrid

I have some tabular data which has a lot of fields in it, and when my WPF application is resized a lot of them are cut off. However, I want to see the first 6 columns always as they are important. How can I achieve this in a grid format? I am using the WPFToolkit DataGrid but can be persuaded to change to a different control if one exist...

Set DataGridTemplateColumn.SortMemberPath to navigation property?

Hi. I want to set the sorting of a WPF DataGridTemlpateColumn to a property of one of the child members in the row. For instance, the DataGrid's ItemsSource is an Array of computers, each of them has a screen, each screen has a button. I want the sorting should be {Binding Screen.Button.Name}. How do I do that? ...

GroupDescriptor in SL4B2

Using Silverlight4, how can I make datagrid grouping look up a display name from another table when the grouping value is a foreign key? I could denormalise the entity so that it resolves the join itself but this introduces update issues. The approach that leaps to mind is a value converter and I shall look into it, but if you have a de...

WPF datageid: disable editing in certain rows

Hi! I have something like orders table binded to datagrid. I want to disable editing on rows, where order date is expired (deadline date > current date): show them greyed and ban entering into edit mode. here what I have <Style TargetType="{x:Type WPFToolkit:DataGridRow}"> <Style.Triggers> <MultiTrigger> <MultiTrigger....