Replies
Assuming you are going with the unbound column solution, you add the column in response to the ColumnSetGenerated event, and assign the actual value for each node in response to the InitializeDataNode event:
private void ultraTree1_ColumnSetGenerated(object sender, ColumnSetGeneratedEventArgs e)
{
TreeColumnsCollection columns = e.ColumnSet.Columns;
UltraTreeNodeColumn imageColumn = columns.Add( "Image" );
imageColumn.DataType = typeof(System.Drawing.Image);
}
private void ultraTree1_InitializeDataNode(object sender, InitializeDataNodeEventArgs e)
{
if ( e.Reinitialize == false )
{
Image image = Image.FromFile( @"C:\Wherever\whatever.bmp");
e.Node.SetCellValue( e.Node.DataColumnSetResolved.Columns["Image"], image );
}
}
I am not aware of any intrinsic support for this in the .NET TreeView control. If you like you can submit a feature request for the ability to control this in UltraTree via a property setting.
An Override object is exposed by the control itself, so set UltraTree.Override.NodeDoubleClickAction.
[quote user="bedfordn"]Is it safe to say there's no appearance property on the control itself for a node when it doesn't have focus?[/quote]
No, there is no Appearance designated specifically for when the control does not have focus. If you like you can submit a feature request for such a property.
private Infragistics.Win.Appearance focusedAppearance = new Infragistics.Win.Appearance();
private Infragistics.Win.Appearance notFocusedAppearance = new Infragistics.Win.Appearance();
this.notFocusedAppearance.BackColor = SystemColors.ControlDark;
this.focusedAppearance.BackColor = SystemColors.Highlight;
this.ultraTree1.Override.SelectedNodeAppearance = this.focusedAppearance;
this.ultraTree1.Enter += new EventHandler(this.ultraTree1_Enter);
this.ultraTree1.Leave += new EventHandler(this.ultraTree1_Leave);
this.ultraTree1.HideSelection = false;
private void ultraTree1_Leave(object sender, EventArgs e)
{
UltraTree tree = sender as UltraTree;
tree.Override.SelectedNodeAppearance = this.notFocusedAppearance;
}
private void ultraTree1_Enter(object sender, EventArgs e)
{
UltraTree tree = sender as UltraTree;
tree.Override.SelectedNodeAppearance = this.focusedAppearance;
}
The Form class exposes a method, 'ValidateChildren', which triggers the Validating event for each child of the form. If you want to call the event handler directly, you should not use CancelEventArgs.Empty, but rather a new instance of CancelEventArgs, because the static Empty property is inherited from the System.EventArgs class, and you need a strongly-typed CancelEventArgs instance to call the event handler directly. Also, the value of the 'sender' parameter should probably be uiTextBox, not this, in case the handler logic is expecting the sender to be of a specific type.
No, the control does not support showing scrollbars for a group. If you like you can submit a feature request the ability to do that.