Toggle parent and children Datagrid wpf - wpf

I have a scenario where I need to place a wpf datagrid inside the rowDetails template of another datagrid.I have the toggle buttons on each row of parent datagrid to expand and collapse that row details template and I had a toggle button in the header column of parent datagrid to expand all the row details templates in one click.Can someone suggest the way to achieve the toggle functionality as explained using mvvm.
Thanks in advance

Related

Placement of context menu on devex grid control

I am using a devexpress grid control to display a grid. The grid shows a context menu. When i right click on a row, the menu is shown but only when the row is a newly added row. It means the menu is visible only on some rows so i have bound its visibility with a property on view model. The problem is if i right click on a row which doesn't show a context menu and then right click on the row which shows the context menu, the menu becomes visible on the last clicked row(the one which doesn't show context). Any help with this?

DataGrid scrolls a row if RowDetails is visible

I have a DataGrid displaying 'Parent' records.
First column has a button to show/hide RowDetails, made using this solution: I need the Expand / Collapse for RowDetailsTemplate.
RowDetailsTemplate is another DataGrid, displaying 'Child' records. One of 'child' columns' is a checkbox.
It all works fine if 'parent' has only a few 'children'.
But if there is a hundred 'children', I have a small problem:
expanding the RowDetails and clicking on any 'child' checkbox - would firstly scroll the 'parent' row to the visual top of the 'parent' grid.
And then I need to find that 'child' again, and click on its checkbox again, to have it checked. Is there a way to 'freeze' a parent, and to have checkbox ticked in just one click?
I think that you just wanted a smooth scrolling in WPF listbox.
Here's an answered question to your problem.
With using:
ScrollViewer.CanContentScroll="False"

On Click on the RowHeader the current row should be editable and On click of the columnHearder current column of all row should be editable

I have a silverlight DataGrid, by default on page load the all the cells of the datagrid should be Readonly. I have 2 problem , can any one help me?
1.On Click on the RowHeader the current row should be editable
2. On click of the columnHearder current column of all row should be editable
This might not solve your entire problem but it should partially address it.
This is to make a column read-only in a datagrid
DataGrid.Columns[7].IsReadOnly = true;
Obviously the property can be changed from events but the data grid does not have row/column headers event handlers. Custom controls seem the way to go without introducing any new gui elements like buttons and changing the feel of the application.

Add a button to a column header in Telerik RadView

Is there a way to put a button in the column header of the Telerik RadGridView component for WPF.
Sure: http://www.telerik.com/help/wpf/gridview-styling-column-headers.html
You'll want to create a new custom GridViewHeaderCellTemplate and put your button in there.
GridViewHeaderCellTemplate - the ControlTemplate, applied to the GridViewCell.
Also see: http://www.telerik.com/help/wpf/radgridview-styles-and-templates-templates-structure.html#GridViewHeaderCell

How to make the listbox rows not able to be selected?

The image above depicts a ListBox. You can see the rows are able to be selected. However they should be not selectable when i click on the row, but i have no idea on how to solve this problem.
My question is, how to make the listbox rows above not able to be selected?
The easiest solution would be to use an ItemsControl instead of a ListBox. It's a similar control that doesn't allow selection.
You can retemplate the control, removing the selected state animation. Easy to do if you have Blend.
Right click on the ListBox, select Edit Additional Templates | Edit Generated Item Container | Edit A Copy. Switch to the States tab and choose the Selected state. (For Silverlight) you should see that the Rectangle "fillColor2" has a red circle, showing it's Opacity property is animated in this state. Expand fillColor2, click Opacity, and press delete. You can also do the same for the Focused state (and MouseOver state, if you don't want a mouseover effect)

Resources