or
Private Sub Timer_RefreshProcessList_Tick(ByVal sender As Object, ByVal e As EventArgs) _Handles Timer_RefreshProcessList.Tick ' Processes that shouldn't be listed. Dim BlackListedProcesses As String() = { My.Application.Info.AssemblyName, "Idle", "System", "audiodg" } ' Get the runing processes. Dim Processes As Process() = Process.GetProcesses ' Filter the processes by its name ' then set the RadListDataItem items containing the names and the process icons. Dim ProcessItems As IEnumerable(Of RadListDataItem) = (From proc As Process In Processes Where Not BlackListedProcesses.Contains(proc.ProcessName) Order By proc.ProcessName Ascending). GroupBy(Function(proc As Process) proc.ProcessName). Select(Function(procs As IGrouping(Of String, Process)) If Not procs.First.HasExited Then Try Return New RadListDataItem With { .Active = False, .Text = String.Format("{0}.exe", procs.First.ProcessName), .Image = ResizeImage(Icon.ExtractAssociatedIcon(procs.First.MainModule.FileName).ToBitmap, Width:=16, Height:=16) } Catch ex As Exception Return Nothing End Try Else Return Nothing End If End Function) ' If the RadListControl does not contain any item then... If Me.RadListControl_ProcessList.Items.Count = 0 Then With Me.RadListControl_ProcessList .BeginUpdate() .Items.AddRange(ProcessItems) ' Add the RadListDataItems for first time. .EndUpdate() End With Exit Sub End If ' If RadListDataItems count is not equal than the runing process list count then... If Me.RadListControl_ProcessList.Items.Count <> ProcessItems.Count Then ' Save the current selected items. Dim SelectedItems As IEnumerable(Of String) = From Item As RadListDataItem In Me.RadListControl_ProcessList.SelectedItems Select Item.Text ' For Each ctrl As RadListDataItem In ProcessItems ' ctrl.Dispose() ' Next With Me.RadListControl_ProcessList ' .AutoScroll = False ' .SuspendSelectionEvents = True ' .SuspendItemsChangeEvents = True ' .SuspendLayout() ' .BeginUpdate() .Items.Clear() ' Clear the current RadListDataItems .Items.AddRange(ProcessItems) ' Add the new RadListDataItems. ' .EndUpdate() ' .ResumeLayout() End With ' Restore the selected item(s). For Each Item As RadListDataItem In Me.RadListControl_ProcessList.Items If SelectedItems.Contains(Item.Text) Then Item.Selected = True Item.Active = True With Me.RadListControl_ProcessList ' .ScrollToItem(Item) ' .ListElement.ScrollToItem(Item) ' .ListElement.ScrollToActiveItem() End With End If Next Item With Me.RadListControl_ProcessList ' .AutoScroll = True ' .SuspendSelectionEvents = False ' .SuspendItemsChangeEvents = False End With End IfEnd Sub' [ListBox] Select item without jump'' Original author of code is "King King"' Url: stackoverflow.com/questions/19479774/how-to-prevent-listbox-jumps-to-item'' Examples :'' Select_Item_Without_Jump(ListBox1, 50, ListBoxItemSelected.Select)'' For x As Integer = 0 To ListBox1.Items.Count - 1' Select_Item_Without_Jump(ListBox1, x, ListBoxItemSelected.Select)' Next''' <summary>''' Indicates whether the ListBox Item should be Selected or Unselected.''' </summary>Private Enum ListBoxItemSelected ''' <summary> ''' Indicate that ListBox Item should be Selected. ''' </summary> [Select] = 1 ''' <summary> ''' Indicate that ListBox Item should be Unselected. ''' </summary> [Unselect] = 0End Enum''' <summary>''' Selects or unselects a ListBox Item without jumping to the Item location on the layout.''' </summary>Public Shared Sub Select_Item_Without_Jump(lb As ListBox, index As Integer, selected As ListBoxItemSelected) Dim i As Integer = lb.TopIndex ' Store the selected item index lb.BeginUpdate() ' Disable drawing on control lb.SetSelected(index, selected) ' Select the item lb.TopIndex = i ' Jump to the previous selected item lb.EndUpdate() ' Eenable drawingEnd Sub


Telerik.Data.Expressions.ExpressionContext.Context = new MyExpressionContext();Telerik.WinControls.UI.RadExpressionEditorForm.ExpressionItemsList.Add( new Telerik.Data.Expressions.ExpressionItem{ Name = "MarketDate (Endur)", Value = "MarketDate()", Syntax = "MarketDate()", Type = Telerik.Data.Expressions.ExpressionItemType.OtherFunc, Description = "Returns the market date as it appears in the market manager."});

Since upgrading from Q2 2010 (Currently on v.2011.2.11.831), I have found an issue with the checkboxes not drawing properly when you click on the parent check box which recursively checks all children nodes (see Main 2 –Subs in jpg). If you expand the node first or after the first time the checkboxes draw properly. Is there a something I can do to force the redraw so the checkboxes paint correctly?
Below is a sample program and the code I use to recursively check the child nodes. If you click on the checkbox of one of the Mains it will check all children and expand it.
using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Telerik.WinControls.UI; namespace TreeViewTest { public partial class Form1 : Form { private System.ComponentModel.IContainer components; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } private Telerik.WinControls.UI.RadTreeView radTreeView1; private void InitializeComponent() { this.radTreeView1 = new Telerik.WinControls.UI.RadTreeView(); ((System.ComponentModel.ISupportInitialize)(this.radTreeView1)).BeginInit(); this.SuspendLayout(); // // radTreeView1 // this.radTreeView1.Location = new System.Drawing.Point(1, 13); this.radTreeView1.Name = "radTreeView1"; this.radTreeView1.Size = new System.Drawing.Size(496, 347); this.radTreeView1.SpacingBetweenNodes = -1; this.radTreeView1.TabIndex = 0; this.radTreeView1.Text = "radTreeView1"; this.radTreeView1.NodeCheckedChanged += new Telerik.WinControls.UI.RadTreeView.TreeViewEventHandler(this.radTreeView1_NodeCheckedChanged); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(497, 372); this.Controls.Add(this.radTreeView1); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); ((System.ComponentModel.ISupportInitialize)(this.radTreeView1)).EndInit(); this.ResumeLayout(false); } public Form1() { InitializeComponent(); } private void radTreeView1_NodeCheckedChanged(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e) { this.radTreeView1.NodeCheckedChanged -= radTreeView1_NodeCheckedChanged; if (e.Node.Nodes.Count > 0) { this.CheckAllChildNodes(e.Node, e.Node.Checked); } e.Node.Expanded = true; RadTreeNode topNode = GetTopNode(e.Node); CheckAllChildNodesForChecked(topNode); this.radTreeView1.NodeCheckedChanged += new RadTreeView.TreeViewEventHandler(radTreeView1_NodeCheckedChanged); } private void CheckAllChildNodes(RadTreeNode treeNode, bool nodeChecked) { foreach (RadTreeNode node in treeNode.Nodes) { node.Checked = nodeChecked; if (node.Nodes.Count > 0) { this.CheckAllChildNodes(node, nodeChecked); } } } private bool CheckAllChildNodesForChecked(RadTreeNode treeNode) { bool childChecked = false; foreach (RadTreeNode node in treeNode.Nodes) { if (node.Nodes.Count > 0) { if (this.CheckAllChildNodesForChecked(node)) { childChecked = true; } } else { if (!childChecked) { childChecked = node.Checked; } } } if (childChecked) { treeNode.Checked = true; } else { treeNode.Checked = false; } return childChecked; } private RadTreeNode GetTopNode(RadTreeNode treeNode) { RadTreeNode topTreeNode = treeNode; if (topTreeNode.Parent != null) { topTreeNode = GetTopNode(topTreeNode.Parent); } return topTreeNode; } private void Form1_Load(object sender, EventArgs e) { radTreeView1.Nodes.Clear(); RadTreeNode root = new RadTreeNode("root"); root.CheckType = CheckType.CheckBox; for (int x = 1; x < 4; x++) { RadTreeNode main = new RadTreeNode("Main " + x.ToString()); main.CheckType = CheckType.CheckBox; for (int y = 1; y < 4; y++) { RadTreeNode sub = new RadTreeNode("Sub " + y.ToString()); sub.CheckType = CheckType.CheckBox; main.Nodes.Add(sub); } main.Expanded = false; root.Nodes.Add(main); } root.Expanded = true; radTreeView1.Nodes.Add(root); } } } 

