To reproduce: this.radGridView1.MultiSelect = true; this.radGridView1.SelectionMode = Telerik.WinControls.UI.GridViewSelectionMode.CellSelect; radGridView1.ShowRowHeaderColumn = false; Then select the cells in the firs column by dragging the mouse. Workaround: // radGridView1.ShowRowHeaderColumn = false; radGridView1.TableElement.RowHeaderColumnWidth = 0;
To reproduce: - Add DateTime columns to the grid and set the MaskType of the editor to FreeFormDateTime. - Go to the new row enter a valid date and press Tab. Workaround: class Myditor : RadDateTimeEditor { public override bool IsModified { get { return true; } } }
To reproduce: this.Controls.Add(this.radGridView1); this.radScheduler1.Dock = DockStyle.Fill; List<GridRec> records = new List<GridRec>(); GridRec rec = new GridRec(); rec.Column1 = "1"; rec.Column2 = "2"; rec.Column3 = "3"; rec.Column4 = "4"; rec.Column5 = "5"; rec.Column6 = "6"; rec.Column7 = "7"; rec.Column8 = "8"; rec.Column9 = "9"; for (int i = 0; i < 20; ++i) { records.Add(rec.Clone()); } radGridView1.DataSource = records; this.radGridView1.MultiSelect = true; this.radGridView1.SelectionMode = GridViewSelectionMode.CellSelect; this.radGridView1.Dock = DockStyle.Fill; public class GridRec { public GridRec Clone() { return this.MemberwiseClone() as GridRec; } public string Column1 { get; set; } public string Column2 { get; set; } public string Column3 { get; set; } public string Column4 { get; set; } public string Column5 { get; set; } public string Column6 { get; set; } public string Column7 { get; set; } public string Column8 { get; set; } public string Column9 { get; set; } } If you run the application, it starts with the upper-left most cell selected. Now, while holding down the Shift key, left-click on the cell in the 5th column of the 5th row (cell 5:5). Note all 25 cells are selected as expected. Now, while still holding Shift, left-click again on cell 5:5 and note the selection is cleared. Now, while still holding Shift, click on cell 4:4 (4th column, 4th row). Note how the selected range is now cells 1:1 through 4:4. And while still holding Shift, if you click on 4:4 yet again, the selection is cleared. Workaround: private void radGridView1_SelectionChanging(object sender, Telerik.WinControls.UI.GridViewSelectionCancelEventArgs e) { if (e.ColumnStartIndex == e.ColumnEndIndex && Control.ModifierKeys == Keys.Shift) { e.Cancel = true; } }
Until released one can format the nodes this way: private void RadGridView1_FilterPopupRequired(object sender, Telerik.WinControls.UI.FilterPopupRequiredEventArgs e) { if (e.Column.GetType().Name == "GridViewDateTimeColumn") { RadListFilterPopup popup = new RadListFilterPopup(e.Column, true); e.FilterPopup = popup; popup.MenuTreeElement.TreeView.NodeFormatting += TreeView_NodeFormatting; } } int monthNumber = -1; private void TreeView_NodeFormatting(object sender, TreeNodeFormattingEventArgs e) { if (e.Node.Level == 2) { if (int.TryParse(e.Node.Text, out monthNumber)) { e.NodeElement.ContentElement.Text = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(monthNumber); } } }
To reproduce: please refer to the attached gif file. 1. Run the attached sample project. 2. Toggle the checkbox and scroll to a specific row. 3. Click the button to hide a column. You will notice that the vertical scrollbar changes its position. If the AutoSizeRows property is set to false, the scrollbar keeps its position. Workaround: private void radToggleButton1_ToggleStateChanged(object sender, Telerik.WinControls.UI.StateChangedEventArgs args) { int scrollBarValue = this.radGridView1.TableElement.VScrollBar.Value; bool visible = true; if (args.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On) { visible = false; } this.radGridView1.MasterTemplate.BeginUpdate(); for (int i = 1; i < this.radGridView1.Columns.Count; i += 2) { this.radGridView1.Columns[i].IsVisible = visible; } this.radGridView1.MasterTemplate.EndUpdate(); this.radGridView1.TableElement.VScrollBar.Value = scrollBarValue; }
Workaround: private void RadForm1_Load(object sender, EventArgs e) { this.categoriesTableAdapter.Fill(this.nwindDataSet.Categories); this.productsTableAdapter.Fill(this.nwindDataSet.Products); radGridView1.AutoGenerateHierarchy = true; radGridView1.DataSource = this.nwindDataSet; radGridView1.DataMember = "Categories"; radGridView1.Rows[0].IsExpanded = !radGridView1.Rows[0].IsExpanded; radGridView1.Rows[0].IsExpanded = !radGridView1.Rows[0].IsExpanded; } Image expandedSign; Image collapsedSign; private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) { GridGroupExpanderCellElement expanderCell = e.CellElement as GridGroupExpanderCellElement; if (expanderCell != null) { if (expandedSign == null && expanderCell.Expander.SignImage != null && e.Row.IsExpanded == false) { expandedSign = expanderCell.Expander.SignImage.Clone() as Image; } if (collapsedSign == null && expanderCell.Expander.SignImage != null && e.Row.IsExpanded == true) { collapsedSign = expanderCell.Expander.SignImage.Clone() as Image; } if (expandedSign != null && collapsedSign != null) { expanderCell.Expander.SignImage = null; } if (e.Row.IsExpanded) { expanderCell.Expander.Image = collapsedSign; } else { expanderCell.Expander.Image = expandedSign; } expanderCell.Expander.ImageLayout = ImageLayout.None; expanderCell.Expander.DrawImage = true; expanderCell.Expander.ImageAlignment = ContentAlignment.TopLeft; } }
Please refer to the attached sample project and follow the steps in the gif file. 1. Open two MDI child forms. 2. Activate the first form and right click on the grid in order to show the context menu and add a shortcut to the menu item. Press Ctrl+N in order to add some new rows to the first grid. 3. Activate the second form and right click on the grid in order to show the context menu and add a shortcut to the menu item. Press Ctrl+N in order to add some new rows to the second grid. However, you will notice that the first several shortcuts combinations are executed for the first grid and then for the active second grid. Workaround: clear the shortcut when the form is deactivated: this.Deactivate += GridForm_Deactivate; private void GridForm_Deactivate(object sender, EventArgs e) { item.Shortcuts.Clear(); } private void GridForm_Activated(object sender, EventArgs e) { this.ActiveControl = this.radGridView1; } RadMenuItem item = new RadMenuItem(); private void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e) { item.Text = "insert row"; item.Shortcuts.Add(new RadShortcut(Keys.Control, Keys.N)); item.Click += item_Click; e.ContextMenu.Items.Add(item); }
To reproduce: please refer to the attached sample project and follow the described steps in the .doc file located in the zip. Workaround: protected override void OnActivated(EventArgs e) { base.OnActivated(e); this.ActiveControl = this.gvDetails; } private void gvDetails_LostFocus(object sender, EventArgs e) { ((ComponentBehavior)gvDetails.Behavior).GetType().GetProperties(BindingFlags.NonPublic | BindingFlags.Instance); PropertyInfo barProperty = ((ComponentBehavior)gvDetails.Behavior).GetType().GetProperty("ScreenPresenter", BindingFlags.NonPublic | BindingFlags.Instance); Form screenTip = barProperty.GetValue(((ComponentBehavior)gvDetails.Behavior), null) as Form; screenTip.Hide(); }
To reproduce: run the attached sample project and you will notice that the top border is missing as it is illustrated in the screenshot. Workaround: set the RadGridView.AutoSizeRows property to false.
Steps to reproduce: 1. Add RadGridView and populate with data 2. Show the context menu many times. Sometimes the popup is not shown correctly. If you click again, the popup is visible correctly. Workaround: Set the AnimationEnabled property to false or the AnimationType property to None. Here is the code snippet how can be achieve it: //Set the AnimationEnabled to false void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e) { RadDropDownMenu contextMenu = e.ContextMenu as RadDropDownMenu; contextMenu.AnimationEnabled = false; } //Set the AnimationType to None void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e) { RadDropDownMenu contextMenu = e.ContextMenu as RadDropDownMenu; contextMenu.AnimationType = PopupAnimationTypes.None; }
How to reproduce: public partial class Form1 : Form { DataTable dt; public Form1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; } private void radButton1_Click(object sender, EventArgs e) { dt.Clear(); for (int i = 0; i < 100; i++) { dt.Rows.Add(i, "New Name " + i, DateTime.Now.AddDays(i), i % 2 == 0); } } private DataTable GetData() { dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Date", typeof(DateTime)); dt.Columns.Add("Bool", typeof(bool)); for (int i = 0; i < 500; i++) { dt.Rows.Add(i, "Name " + i, DateTime.Now.AddDays(i), i % 2 == 0); } return dt; } } Workaround: public partial class Form1 : Form { DataTable dt; public Form1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; this.radGridView1.RowsChanged += RadGridView1_RowsChanged; } private void RadGridView1_RowsChanged(object sender, Telerik.WinControls.UI.GridViewCollectionChangedEventArgs e) { if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Reset) { this.radGridView1.MasterView.PinnedRows.GetType().GetMethod("Clear", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .Invoke(this.radGridView1.MasterView.PinnedRows, new object[] { }); } } private void radButton1_Click(object sender, EventArgs e) { dt.Clear(); for (int i = 0; i < 100; i++) { dt.Rows.Add(i, "New Name " + i, DateTime.Now.AddDays(i), i % 2 == 0); } } private DataTable GetData() { dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Date", typeof(DateTime)); dt.Columns.Add("Bool", typeof(bool)); for (int i = 0; i < 500; i++) { dt.Rows.Add(i, "Name " + i, DateTime.Now.AddDays(i), i % 2 == 0); } return dt; } }
To reproduce: - Add default values for all cells in the grid. - Try to add the new row without changing any value. Workaround: private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { var editor = radGridView1.ActiveEditor as BaseInputEditor; var field = editor.GetType().GetField("originalValue", BindingFlags.NonPublic | BindingFlags.Instance); field.SetValue(editor, "asd"); }
To reproduce: please refer to the attached sample project and gif file illustrating the behavior. Workaround: in order to cancel adding of the new row, you can call the MasterView.TableAddNewRow.CancelAddNewRow method: private void radGridView1_UserAddingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { e.Cancel = true; this.radGridView1.MasterView.TableAddNewRow.CancelAddNewRow(); int index = this.radGridView1.Rows.Count; this.radGridView1.Rows.Add(index, "Row" + index); }
To reproduce: please refer to the attached sample project. Workaround: this.radGridView1.TableElement.ScrollToRow(this.radGridView1.RowCount-1);
Please refer to the attached sample project and gif file illustrating the problem. Workaround: Sub New() InitializeComponent() AddHandler Me.RadGridView1.CreateCell, AddressOf RadGridView_CreateCell End Sub Public Class CustomGridFilterCellElement Inherits GridFilterCellElement Protected Overrides ReadOnly Property ThemeEffectiveType() As Type Get Return GetType(GridFilterCellElement) End Get End Property Public Sub New(column As GridViewDataColumn, row As GridRowElement) MyBase.New(column, row) End Sub Protected Overrides Function ApplyFormatString(value As Object) As String Return CDate(value).ToString("dd.MM.yyyy") End Function End Class
GridViewSpreadExport does not export correctly more than one child templates from second level.
To reproduce: public RadForm1() { InitializeComponent(); radGridView1.DataSource = GetTable(); GridViewSummaryItem summaryItem = new GridViewSummaryItem(); summaryItem.Name = "Name"; summaryItem.Aggregate = GridAggregateFunction.Count; GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(); summaryRowItem.Add(summaryItem); this.radGridView1.SummaryRowsBottom.Add(summaryRowItem); radGridView1.ViewCellFormatting += RadGridView1_ViewCellFormatting; } private void RadGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridSummaryCellElement) { e.CellElement.DrawFill = true; e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; e.CellElement.BackColor = Color.Red; } else { e.CellElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, Telerik.WinControls.ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, Telerik.WinControls.ValueResetFlags.Local); } } protected override void OnLoad(EventArgs e) { base.OnLoad(e); radGridView1.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom; } static DataTable GetTable() { DataTable table = new DataTable(); table.Columns.Add("Dosage", typeof(int)); table.Columns.Add("Drug", typeof(string)); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Date", typeof(DateTime)); for (int i = 0; i < 5; i++) { table.Rows.Add(25, "Indocin", "David", DateTime.Now); table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now); table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now); table.Rows.Add(21, "Combivent", "Janet", DateTime.Now); table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now); } return table; } private void radButton1_Click(object sender, EventArgs e) { radGridView1.SaveLayout("test.xml"); } private void radButton2_Click(object sender, EventArgs e) { radGridView1.SummaryRowsBottom.Clear(); radGridView1.SummaryRowsTop.Clear(); radGridView1.LoadLayout("test.xml"); }
Steps to reproduce: 1. Add a CompositeFilterDescriptor programmatically as it is demonstrated in the following help article: http://docs.telerik.com/devtools/winforms/gridview/filtering/setting-filters-programmatically-(composite-descriptors) 2. Save the layout. 3. Load the layout. Use attached project to reproduce. Workaround: Seth te PropertyName to a valid column name.