Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Change a node's image when in-place editors are activated and closed

The example below handles the following events to change the focused node’s images:

  • TreeList.ShownEditor — sets the node’s state image to indicate that the node is being modified. This event fires when the editor is activated.
  • TreeList.HiddenEditor — removes the node’s state image. This event fires when the editor is deactivated.
  • TreeList.CellValueChanged — sets the node’s select image to indicate that the value has been modified.

cdShowingHidingEditors

using DevExpress.XtraTreeList;

private void treeList1_ShownEditor(object sender, System.EventArgs e) {
   TreeList tlist = sender as TreeList;
   tlist.FocusedNode.StateImageIndex = 0;
}

private void treeList1_HiddenEditor(object sender, System.EventArgs e) {
   TreeList tlist = sender as TreeList;
   tlist.FocusedNode.StateImageIndex = -1;
}

private void treeList1_CellValueChanged(object sender, 
DevExpress.XtraTreeList.CellValueChangedEventArgs e) {
   e.Node.SelectImageIndex = 1;
   e.Node.ImageIndex = 1;
}