Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
907
Is cell editing allowed yet?
posted

I've been using ultraTree since 2005 and for checkboxes implemented the mouse_click event in order to get check boxes to work...

The list of features added since, seems to hint that editing is allowed now, however my attempts to get it workign through the configuration windows have not been successful...

I've placed both a checkbox and a text editor and the cell does change for the text box using the editorControl property on a column (outlook mode).  I've changed AllowCellEdit to Full.  I've bound to the TextChanged, AfterCheck and CellValueChanged events.  However, I have no edit capability in the cells and of course the events never get triggered.  The old style code I used for check boxes is included below and works fine, but that trick does not work for text editing of course...  So if anyone has an example of text editing in a cell, I would appreciate it...

// *******************************************************************************************

// All of the following code handle the various input events for the tree control, that allows

// users to select and unselect fields and records as well as setting cascade values.

// *******************************************************************************************

private void ultraTreeFields_Click(object sender, EventArgs e) {

UIElement lastElement = ultraTreeFields.UIElement.LastElementEntered;

UltraTreeNodeCell cell =

lastElement.GetContext(typeof(UltraTreeNodeCell), true) as UltraTreeNodeCell;

if (cell == null || cell.UIElement == null || cell.UIElement.Enabled == false) return;if (cell.Key.Equals("CascadeAdd")) {

SetCheckedCell(cell);

}
else if (cell.Key.Equals("CascadeDelete")) {

SetCheckedCell(cell);

}
else if (cell.Key.Equals("Selected")) {

ToggleSelection(cell.Node);

}

}

private void SetCheckedCell(UltraTreeNodeCell cell) {

if (cell.Value != null && cell.Value is Boolean) {

bool value = !Convert.ToBoolean(cell.Value);

cell.Value = value;

}

ObjectChanged();

}