I've got a hierarchy gridView in my winform that allows the user to pick items to include.
In the hierarchy the parent is a "category", and the child rows are "category items".
In the grid, there's 2 columns for both the parents and children: a checkbox (Include?) and a textbox ("category name" for parent rows, "item name" for child rows).
The checkbox in the parent row in the grid is equivalent to a "Select All" at the top of a grid used to check all items, but instead of checking all items in the grid, when check, only the checkbox of it's child rows should be checked. This way the user can pick individual "items" to include, or all items in a category, by clicking one checkbox.
The primary problem I've had with this is that when a parent row checkbox item is checked, the checkboxes of that category's child rows don't get checked until a second checkbox in the grid is checked. It's like the checkbox checking/unchecking isn't actually performed until another event fires.
I've tried handling this in rowChanged, valueChanged, CellEndEdit, CellValueChanged, and other events, and they all seem to do what I want in debugging, but the visible checking of child row checkboxes doesn't happen when it should.
I'm opposed to posting any of the code I've tried since I've tried so many approaches and just seem to be going round and round, but will instead put it in pseudocode format. So here's what I'm trying to accomplish:
Private Sub gridItems_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gridItems.ValueChanged
'If the changed item is a parent row checkbox Then
' For each childRow in currentRow.childRows
' childRow.checkboxColumn.checkboxEditor.Value = currentRow.checkboxColumn.checkBoxEditor.Value
' Next
'End If
End Sub
Thank you in advance for any suggestions and advice.
Dan
Hi,
I need to have a grid which can simulate the pivoting behavior of a
pivot grid. I know Telerik does not have a pivot grid in Winforms,
but would like to know if such a thing can be implemented somehow.
In the snapshot attached, pivoting has been done on 2 columns
"Designation" and "Age". The remaining columns can either show the count
of values or the sum of values.
Hoping for your help,
Thanks and regards,
Nihar.
public partial class SPRadButton : Telerik.WinControls.UI.RadForm |
{ |
public SPRadButton() |
{ |
InitializeComponent(); |
} |
private void radButton1_Click(object sender, EventArgs e) |
{ |
RadMessageBox.Show("success"); |
} |
} |
partial class SPRadButton |
{ |
/// <summary> |
/// Required designer variable. |
/// </summary> |
private System.ComponentModel.IContainer components = null; |
/// <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); |
} |
#region Windows Form Designer generated code |
/// <summary> |
/// Required method for Designer support - do not modify |
/// the contents of this method with the code editor. |
/// </summary> |
private void InitializeComponent() |
{ |
this.components = new System.ComponentModel.Container(); |
Telerik.WinControls.Keyboard.InputBinding inputBinding1 = new Telerik.WinControls.Keyboard.InputBinding(); |
Telerik.WinControls.Keyboard.Chord chord1 = new Telerik.WinControls.Keyboard.Chord(); |
Telerik.WinControls.Keyboard.ChordModifier chordModifier1 = new Telerik.WinControls.Keyboard.ChordModifier(); |
Telerik.WinControls.Elements.ClickCommand clickCommand1 = new Telerik.WinControls.Elements.ClickCommand(); |
Telerik.WinControls.Keyboard.InputBinding inputBinding2 = new Telerik.WinControls.Keyboard.InputBinding(); |
Telerik.WinControls.Keyboard.Chord chord2 = new Telerik.WinControls.Keyboard.Chord(); |
Telerik.WinControls.Keyboard.ChordModifier chordModifier2 = new Telerik.WinControls.Keyboard.ChordModifier(); |
Telerik.WinControls.Elements.FocusCommand focusCommand1 = new Telerik.WinControls.Elements.FocusCommand(); |
Telerik.WinControls.Keyboard.InputBinding inputBinding3 = new Telerik.WinControls.Keyboard.InputBinding(); |
Telerik.WinControls.Keyboard.Chord chord3 = new Telerik.WinControls.Keyboard.Chord(); |
Telerik.WinControls.Keyboard.ChordModifier chordModifier3 = new Telerik.WinControls.Keyboard.ChordModifier(); |
Telerik.WinControls.Elements.ClickCommand clickCommand2 = new Telerik.WinControls.Elements.ClickCommand(); |
this.radButton1 = new Telerik.WinControls.UI.RadButton(); |
this.radTextBox1 = new Telerik.WinControls.UI.RadTextBox(); |
this.shortcuts1 = new Telerik.WinControls.Keyboard.Shortcuts(this.components); |
((System.ComponentModel.ISupportInitialize)(this.radButton1)).BeginInit(); |
((System.ComponentModel.ISupportInitialize)(this.radTextBox1)).BeginInit(); |
((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); |
this.SuspendLayout(); |
// |
// radButton1 |
// |
chordModifier1.AltModifier = false; |
chordModifier1.ControlModifier = true; |
chordModifier1.ShiftModifier = false; |
chord1.ChordModifier = chordModifier1; |
chord1.Keys = "Ctrl+N"; |
inputBinding1.Chord = chord1; |
clickCommand1.ContextType = null; |
clickCommand1.ImageList = null; |
clickCommand1.Name = "ActionCommand"; |
clickCommand1.OwnerType = typeof(Telerik.WinControls.RadItem); |
clickCommand1.Text = "This command rises the Click event of a selected RadItem instance."; |
clickCommand1.Type = ""; |
inputBinding1.Command = clickCommand1; |
inputBinding1.CommandContext = this.radButton1; |
this.radButton1.CommandBindings.AddRange(new Telerik.WinControls.Keyboard.InputBinding[] { |
inputBinding1}); |
this.radButton1.Location = new System.Drawing.Point(30, 23); |
this.radButton1.Name = "radButton1"; |
this.radButton1.Size = new System.Drawing.Size(237, 23); |
this.radButton1.TabIndex = 0; |
this.radButton1.Text = "CTRL+N"; |
this.radButton1.Click += new System.EventHandler(this.radButton1_Click); |
// |
// radTextBox1 |
// |
this.radTextBox1.Location = new System.Drawing.Point(30, 52); |
this.radTextBox1.Name = "radTextBox1"; |
this.radTextBox1.NullText = "Press CTRL+F to focus"; |
this.radTextBox1.Size = new System.Drawing.Size(237, 20); |
this.radTextBox1.TabIndex = 1; |
// |
// shortcuts1 |
// |
chordModifier2.AltModifier = false; |
chordModifier2.ControlModifier = true; |
chordModifier2.ShiftModifier = false; |
chord2.ChordModifier = chordModifier2; |
chord2.Keys = "Ctrl+F"; |
inputBinding2.Chord = chord2; |
focusCommand1.ContextType = null; |
focusCommand1.ImageList = null; |
focusCommand1.Name = "FocusCommand"; |
focusCommand1.OwnerType = typeof(Telerik.WinControls.RadItem); |
focusCommand1.Text = "This command gives the focus to a selected RadItem instance."; |
focusCommand1.Type = ""; |
inputBinding2.Command = focusCommand1; |
inputBinding2.CommandContext = this.radTextBox1; |
chordModifier3.AltModifier = false; |
chordModifier3.ControlModifier = true; |
chordModifier3.ShiftModifier = false; |
chord3.ChordModifier = chordModifier3; |
chord3.Keys = "Ctrl+N"; |
inputBinding3.Chord = chord3; |
clickCommand2.ContextType = null; |
clickCommand2.ImageList = null; |
clickCommand2.Name = "ActionCommand"; |
clickCommand2.OwnerType = typeof(Telerik.WinControls.RadItem); |
clickCommand2.Text = "This command rises the Click event of a selected RadItem instance."; |
clickCommand2.Type = ""; |
inputBinding3.Command = clickCommand2; |
inputBinding3.CommandContext = this.radButton1; |
this.shortcuts1.InputBindings.AddRange(new Telerik.WinControls.Keyboard.InputBinding[] { |
inputBinding2, |
inputBinding3}); |
thisthis.shortcuts1.Owner = this; |
// |
// SPRadButton |
// |
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
this.ClientSize = new System.Drawing.Size(293, 88); |
this.Controls.Add(this.radTextBox1); |
this.Controls.Add(this.radButton1); |
this.Name = "SPRadButton"; |
// |
// |
// |
this.RootElement.ApplyShapeToControl = true; |
this.Text = "RadForm1"; |
this.ThemeName = "ControlDefault"; |
((System.ComponentModel.ISupportInitialize)(this.radButton1)).EndInit(); |
((System.ComponentModel.ISupportInitialize)(this.radTextBox1)).EndInit(); |
((System.ComponentModel.ISupportInitialize)(this)).EndInit(); |
this.ResumeLayout(false); |
this.PerformLayout(); |
} |
#endregion |
private Telerik.WinControls.UI.RadButton radButton1; |
private Telerik.WinControls.Keyboard.Shortcuts shortcuts1; |
private Telerik.WinControls.UI.RadTextBox radTextBox1; |
} |