I mean from the code. I know the Name of one column and want to edit all the cells of it.
**Sorry for the second post. I can't edit the first one.**
Lance | Manager Technical Support
answered on 05 Apr 2018, 02:42 PM
It's not possible to select all the cells in a column with a single gesture (i.e. column header tap), However, if the DataGrid uses SelectionUnit=Cell and SelectionMode=Multiple, then you can programmatically select each cell in a loop. For more information, go to the DataGrid Selection documentation.
For your convenience, I'll highlight the relevant properties in the pasted informaiton below:
SelectionUnit property (type of DataGridSelectionUnit):
- Row: The unit to select is a grid row(by default).
- Cell: The unit to select is a cell within a grid row.
To define a Cell when using a selection you can use the DataGridCellInfo class, that holds all the information about it. To define a Row when using a selection you can use your data object.
SelectionMode property (type of DataGridSelectionMode):
- Single: Single unit may be selected(by default).
- Multiple: Multiple units may be selected.
- None: No selection is allowed.
Additional functionalities for programmatic selecting and deselecting items are exposed by this component as methods. They also depend on the applied SelectionUnit.
- SelectItem(object item): Selects the specified data item and adds it in the SelectedItems collection.
- DeselectItem(object item): Removes the selection for the specified data item and removes it from the SelectedItems collection.
- SelectCell(DataGridCellInfo item): Selects the grid cell as defined by the specified cell info.
- DeselectCell(DataGridCellInfo item): Removes the selection for the grid cell defined by the specified cell info.
- SelectAll(): Selects all the items as defined by the SelectionMode and SelectionUnit property.
- DeselectAll(): Clears the current selected items as defined by the SelectionUnit property
As far as editing goes, you can change the underlying property value. Make sure you have PropertyChanged wired up or else the UI will not display the changes.
Lance | Tech Support Engineer, Sr.
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items