private void compareNodeValues(object sender, CompareNodeValuesEventArgs e) { if (e.Node1 == null) { return; } //we do not want to sort the root nodes if (e.Node1.Level == 0) { e.Result = 0; } }
private void compareNodeValues(object sender, CompareNodeValuesEventArgs e) { //we only want to sort for the top nodes (level 0) if (e.Node1 == null) { return; } //the first two levels are defined in presenter. if (e.Node1.Level < 2) { e.Result = 0; } }
private void compareNodeValues(object sender, CompareNodeValuesEventArgs e) { //we only want to sort for the top nodes (level 0) if (e.Node1 == null) { return; } //we do not want to sort the root nodes if (e.Node1.Level == 0) { e.Result = 0; } //we do not want to sort the items under the simulation node (i.e. no children). Otherwise, Nodes are sorted alphabetically else if (nodeIsSimulationNode(e.Node1.ParentNode)) { e.Result = 0; } }
private void treeView_CompareNodeValues( object sender, CompareNodeValuesEventArgs e) { var tx = e.Node1; var ty = e.Node2; if (tx.Tag is FileInformation && ty.Tag is FileInformation) { var u = (FileInformation)tx.Tag; var v = (FileInformation)ty.Tag; e.Result = u.CompareTo(v); } else { // If they are the same length, call Compare. e.Result = string.Compare( ConvertHelper.ToString(tx[0]), ConvertHelper.ToString(ty[0])); } }