private void SignalTreeView_NodeFormatting(object sender, TreeNodeFormattingEventArgs e) { DataRowView rowView = (DataRowView)e.Node.DataBoundItem; e.NodeElement.ImageElement.Image = (Image)rowView[TreeNodes.COL_ICON]; TreeNode tn = rowView[TreeNodes.COL_ITEM] as TreeNode; if (tn is FolderNode && e.Node.Nodes.Count == 0) { e.NodeElement.Visibility = ElementVisibility.Collapsed; } }With radGridView
Dim dtFromCol As New GridViewDateTimeColumn("FromDate")
With dtFromCol
.Format = DateTimePickerFormat.Custom
.CustomFormat = "M/d/yy" 'I'm looking for the shortest date format, i.e. 1/1/12 or 12/31/12
.Width = 70
End With
.Columns.Add(dtFromCol)
.
.Other columns follow
.
End With
When I click the cell I get the datetime picker & the date selected shows up in the desired format (M/d/yy) in the cell, but when I click or Tab away from the cell the cell value changes to a long date format like 2/14/2012 12:00:00 AM . I'm trying not to display the full year (2012) and I don't want the time.
I have tryed customizing the cell's editor in the CellEditorInitialized event or forcing the desired date into the cell in the CellValidated event to no avail. Thanks for any help.
if
(expanded.Contains(item.DataBoundItem))
{
item.IsExpanded =
true;
}
Public Class Form2 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.RadTreeView1 = New Telerik.WinControls.UI.RadTreeView() Me.CheckBox1 = New System.Windows.Forms.CheckBox() CType(Me.RadTreeView1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'RadTreeView1 ' Me.RadTreeView1.BackColor = System.Drawing.SystemColors.Control Me.RadTreeView1.Cursor = System.Windows.Forms.Cursors.Default Me.RadTreeView1.Font = New System.Drawing.Font("Segoe UI", 8.25!) Me.RadTreeView1.ForeColor = System.Drawing.Color.Black Me.RadTreeView1.Location = New System.Drawing.Point(12, 11) Me.RadTreeView1.Name = "RadTreeView1" Me.RadTreeView1.RightToLeft = System.Windows.Forms.RightToLeft.No ' ' ' Me.RadTreeView1.RootElement.ForeColor = System.Drawing.Color.Black Me.RadTreeView1.Size = New System.Drawing.Size(150, 250) Me.RadTreeView1.SpacingBetweenNodes = -1 Me.RadTreeView1.TabIndex = 3 Me.RadTreeView1.Text = "RadTreeView1" ' 'CheckBox1 ' Me.CheckBox1.AutoSize = True Me.CheckBox1.Location = New System.Drawing.Point(168, 23) Me.CheckBox1.Name = "CheckBox1" Me.CheckBox1.Size = New System.Drawing.Size(81, 17) Me.CheckBox1.TabIndex = 4 Me.CheckBox1.Text = "CheckBox1" Me.CheckBox1.UseVisualStyleBackColor = True ' 'Form2 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(292, 273) Me.Controls.Add(Me.CheckBox1) Me.Controls.Add(Me.RadTreeView1) Me.Name = "Form2" Me.Text = "Form2" CType(Me.RadTreeView1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents RadTreeView1 As Telerik.WinControls.UI.RadTreeView Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load For i = 0 To 20 Dim node = RadTreeView1.Nodes.Add("node " + i.ToString) For j = 0 To 20 Dim n2 = node.Nodes.Add("node " + i.ToString + " " + j.ToString) Next Next RadTreeView1.LazyMode = True End Sub Private Sub RadTreeView1_NodeExpandedChanged(sender As System.Object, e As Telerik.WinControls.UI.RadTreeViewEventArgs) Handles RadTreeView1.NodeExpandedChanged Dim n = RadTreeView1.SelectedNode If n Is Nothing Then Return If CheckBox1.Checked Then n.Nodes.Clear() Else While n.Nodes.Count > 0 n.Nodes.RemoveAt(0) End While End If For i = 0 To 10 Dim node = n.Nodes.Add("Expando " + i.ToString) Next End SubEnd ClassMicrosoft Windows Server 2003, Standard Edition, Service Pack 2
English (Australia)
.NET 4.0.30319 SP1Rel, Visual Studio 2010 Version 10.0.40219.1 SP1Rel
Runtime Version v2.0.50727, Version 2011.2.11.831

Hi,
I am displaying data in the grid as hierarchical form using a self reference, here treeview column is displayed in the first column as shown in attached screen shot1 but i need to display the treeview node in second column instead of first column as shown in attached screen shot 2. How can i achieve the output shown in screen shot 2?
Thanks..
