Customize the UI programmatically
You can manipulate the controls easily with two powerful extension methods:
- ParentOfType<>
- ChildrenOfType<>.
You can access all items currently available in RadGridView through RadGridView.Items collection.
Generally we do not recommend working with the visual elements as RadGridView is a virtualized control and its elements are reused as they go in and out the visual area. You can check the topic on UI virtualization for further information.
Here are several small demos for RadGridView:
- Get all grid rows:
- Get all grid cells:
- Get all grid header cells:
- Get (and show) new row:
- Find the grid vertical scrollbar and scroll the grid to bottom:
- Select specific row(s):
- Change specific cell(s) content:
- Put specific cell in edit mode:
- Get visible rows count on scroll or size change:
- Perform conditional row(s) formatting:
- Expand first row in case of hierarchy:
- Collapse first group header row:
- Modify background for all cells in specific column:
- Increase header row Height:
- Check all CheckBox controls in specific column: