Select all the cells from a column

3 posts, 0 answers
  1. Stavros
    Stavros avatar
    18 posts
    Member since:
    Oct 2017

    Posted 05 Apr 2018 Link to this post

    Hi, 

    Is there any way to select and edit all the cells from a specific column?

    Regards,

    Stavros

     

  2. Stavros
    Stavros avatar
    18 posts
    Member since:
    Oct 2017

    Posted 05 Apr 2018 in reply to Stavros Link to this post

    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.**
  3. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 05 Apr 2018 Link to this post

    Hi Stavros,

    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.
    Editing

    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.

    Regards,
    Lance | Tech Support Engineer, Sr.
    Progress Telerik
    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? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top