How can I changed the style of acell? - wpf

I use the cell selection changed event to set style of the cell in rad grid view. the problem is that the changing is not consistent.for example by selecting entire row the previously changed cells is lost!
how can I solve this problem?

You can change the Selection Unit for the grid from both row and cell to just cell.
http://docs.telerik.com/devtools/wpf/controls/radgridview/selection/mixed-selection

Related

Automatically add row in ng-grid when tabbing last cell

I need one working example, to add row while tabbing last cell
I have four cells in one row once we filled and tabbing from last cell it should be add new row.
I tried but i'm unable to find.
http://angular-ui.github.io/ui-grid/ (Edit On Focus Cell Selection Example)
[http://codepen.io/calendee/pen/buCHf][1]
in inside row i have text inupt.
Thanks
Maybe you can add your logic inside this handler:
$scope.gridApi.edit.on.afterCellEdit($scope,function(rowEntity, colDef){
})

How to remove focus from the Infragistics ultragrid cell when clicking outside?

I have an infragistics ultragrid control in a windows form. There is an 'Add New' button outside to insert new rows to the grid.
The problem I faced is, when I click the button outside the grid, while I'm editing a cell inside the grid, the cell doesn't lose focus. Because of this the edited new value is not updated to its underlying data source.
I need this cell to lose focus and update it's underlying data source, because the 'Add New' button creates a new row with this particular column having a default value which is calculated based on the previous row's edited value.
So any ideas on how to unfocus the ultragrid cell? This situation may apply to normal GridView also.
If your button is on a Toolbar, then the behavior you are seeing is expected because toolbars don't take focus. If this is the case before performing your logic you can use the PerformAction method of the grid and pass in UltraGridAction.CommitRow to force the row that was being editor to commit its updates.
For example:
this.ultraGrid1.PerformAction(UltraGridAction.CommitRow);
I used myUltraGrid.ActiveRow.Cells[0].Activate(); which also works. But the solution by #alhalama is better one I guess.

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.

Datagrid Row Selection On Button Click In WPF

I am having a Datagrid that gets populated with values from a DataTable. In my program i have four buttons: Goto First, Last, Next and Previous, as the name name indicates i have to select the rows based on the selection made using these buttons. Everything seems well if i use the below code to get the row (for example first row).
DataGridRow row =(DataGridRow)userControl.m_DataGrid.ItemContainerGenerator.ContainerFromIndex(0);
row.IsSelected = true;
But the code throws null value when there is more rows than the height of the Datagrid(When scrollbar comes into picture).
Please help me out of this issue. I think this is because of the view problem.
Due to virtualization the containers are only created when the object is in view, so you could first scroll the item into view using the respective method, wait for the creation of the container and then select it.
As this is rather messy i would suggest binding the IsSelected to a property on your item using a style for DataGridRow (set it as ItemContainerStyle). Then you can just set the property to true and scroll the item into view if need be.

WPF DataGrid: edit all cells, new row position, click once to edit

I was wondering if anyone could point me into the right direction with DataGrids.
I'm trying to position the new row at the top of the grid
When the user clicks a cell all cells in the row move into an editable state.
Cheers
Check this out for single click editing:
http://wpf.codeplex.com/wikipage?title=Single-Click%20Editing
And this for New row formatting:
http://blogs.msdn.com/b/vinsibal/archive/2008/11/05/wpf-datagrid-new-item-template-sample.aspx
I think positioning a new row on top might not be possible as the new item row is not part of the DataGrid's control template. Haven't given it a try though.

Resources