Workaround: private void radGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e) { GridBrowseEditor browseEditor = e.ActiveEditor as GridBrowseEditor; if (browseEditor!=null) { browseEditor.EditorElement.MinSize = new Size(0,18); GridBrowseEditorElement el = browseEditor.EditorElement as GridBrowseEditorElement; el.TextBoxItem.TextBoxControl.MinimumSize = new Size(0, 13); } }
When scrolling to the bottom of the grid with the mouse, the last row is not lined up with the bottom of the grid. Also, when doing this, clicking on any row, leads to row jumping down to align properly, but a different row is selected. Workaround: public Form1() { InitializeComponent(); radGridView1.MouseDown+=radGridView1_MouseDown; radGridView1.MouseUp+=radGridView1_MouseUp; } bool scrolling = false; private void radGridView1_MouseDown(object sender, MouseEventArgs e) { ScrollBarThumb thumb = radGridView1.ElementTree.GetElementAtPoint(e.Location) as ScrollBarThumb; if (thumb != null) { scrolling = true; } } private void radGridView1_MouseUp(object sender, MouseEventArgs e) { if (scrolling) { scrolling = false; int scrollBarValue = radGridView1.TableElement.VScrollBar.Value; radGridView1.MasterTemplate.Refresh(); radGridView1.TableElement.VScrollBar.Value = scrollBarValue; } }
To reproduce: use the following code snippet and follow the steps in the attached gif file. private void Form1_Load(object sender, EventArgs e) { this.order_DetailsTableAdapter.Fill(this.nwindDataSet.Order_Details); this.ordersTableAdapter.Fill(this.nwindDataSet.Orders); radGridView1.AutoGenerateHierarchy = true; radGridView1.DataSource = this.nwindDataSet; radGridView1.DataMember = "Orders"; radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; radGridView1.MasterTemplate.Templates.First().AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; radGridView1.EnablePaging = true; radGridView1.MasterTemplate.Templates.First().EnableFiltering = true; FilterDescriptor fd = new FilterDescriptor(); fd.PropertyName = "UnitPrice"; fd.Operator = FilterOperator.IsGreaterThan; fd.Value = 40; radGridView1.MasterTemplate.Templates.First().FilterDescriptors.Add(fd); radGridView1.MouseDown += radGridView1_MouseDown; } private void radGridView1_MouseDown(object sender, MouseEventArgs e) { GridDetailViewCellElement detailCell = radGridView1.ElementTree.GetElementAtPoint(e.Location) as GridDetailViewCellElement; if (detailCell != null) { radGridView1.MasterTemplate.Templates.First().FilterDescriptors.Clear(); } } Workaround: private void radGridView1_MouseDown(object sender, MouseEventArgs e) { GridDetailViewCellElement detailCell = radGridView1.ElementTree.GetElementAtPoint(e.Location) as GridDetailViewCellElement; if (detailCell != null) { radGridView1.MasterTemplate.Templates.First().FilterDescriptors.Clear(); GridViewHierarchyRowInfo hierarchyRow = (GridViewHierarchyRowInfo)((GridViewDetailsRowInfo)detailCell.RowInfo).Owner; hierarchyRow.IsExpanded = ! hierarchyRow.IsExpanded; hierarchyRow.IsExpanded = ! hierarchyRow.IsExpanded; hierarchyRow.ChildRows.Last().EnsureVisible(); } }
To reproduce: - Enable the search row in the grid. - Enter some text in the search text box in order to mark some rows. - Refresh the master template. - Notice that the text is cleared, but the formatting remains. Workaround, use the following custom cell: class MyGridSearchCellElement : GridSearchCellElement { public MyGridSearchCellElement(GridViewColumn column, GridRowElement row) :base (column, row) { } bool performSearch = true; protected override void SyncLabelText() { //base.SyncLabelText(); GridViewSearchRowInfo searchRow = this.RowInfo as GridViewSearchRowInfo; if (searchRow == null) { return; } performSearch = false; string searchCriteria = typeof(GridViewSearchRowInfo).GetField("searchCriteria", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(searchRow).ToString(); if (string.IsNullOrEmpty(searchCriteria)) { this.SearchTextBox.Text = String.Empty; this.SearchTextBox.SearchInfoLabel.Text = String.Empty; } else { this.SearchTextBox.Text = searchCriteria; this.SearchTextBox.SearchInfoLabel.Text = string.Format("{0} {1} {2}", searchRow.CurrentResultIndex + 1, Telerik.WinControls.UI.Localization.RadGridLocalizationProvider.CurrentProvider.GetLocalizedString(Telerik.WinControls.UI.Localization.RadGridStringId.SearchRowResultsOfLabel), searchRow.CurrentSearchResultsCount); } performSearch = true; } protected override void Search() { if (!performSearch) { return; } base.Search(); } } To put it in action, use the CreateCell event of RadGridView: void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e) { if (e.CellType == typeof( GridSearchCellElement)) { e.CellElement = new MyGridSearchCellElement(e.Column, e.Row); } }
To reproduce: - Bind the grid to an ObservableCollection and set its AddNewBoundRowBeforeEdit property to true. - Click in the new row and then click back in already added row.
To reproduce: use the following code snippet: public Form1() { InitializeComponent(); GridViewComboBoxColumn supplierColumn = new GridViewComboBoxColumn("SupplierID"); supplierColumn.DataSource = this.suppliersBindingSource; supplierColumn.ValueMember = "SupplierID"; supplierColumn.DisplayMember = "ContactName"; supplierColumn.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown; this.radGridView1.Columns.Add(supplierColumn); this.radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized; } private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor; if (editor != null) { RadDropDownListEditorElement el = editor.EditorElement as RadDropDownListEditorElement; el.SelectedIndexChanging -= el_SelectedIndexChanging; el.SelectedIndexChanging += el_SelectedIndexChanging; el.SelectedIndexChanged -= el_SelectedIndexChanged; el.SelectedIndexChanged += el_SelectedIndexChanged; } } private void el_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e) { Console.WriteLine("Changed"); } private void el_SelectedIndexChanging(object sender, Telerik.WinControls.UI.Data.PositionChangingCancelEventArgs e) { e.Cancel = true; } private void Form1_Load(object sender, EventArgs e) { this.suppliersTableAdapter.Fill(this.nwindDataSet.Suppliers); } When the editor is initialized you will notice that the editor's value can be changed by using the mouse wheel no matter that the SelectedIndexChanging event is cancelled.
To reproduce: Set these properties: radGridView1.SelectionMode = GridViewSelectionMode.FullRowSelect; radGridView1.MultiSelect = true; Select a row, hold Ctrl and click the same cell which is selected, you will see that the SelectionChanging event, along with the SelectionChanged one will not be fired. Workaround: Use the PropertyChanging event of the rows: this.Grid.Rows.ToList().ForEach(x => x.PropertyChanging += x_PropertyChanging); .... void x_PropertyChanging(object sender, Telerik.WinControls.Interfaces.PropertyChangingEventArgsEx e) { if (e.PropertyName == "IsSelected") { } }
To reproduce: - Bind the grid to a binding list of custom property which has a bool value. - Add a filter that shows only false values. - Change some (more than one) of the underlying values to true. - You will notice that the rows with the new value are still visible.
RadDateTimeEditor the entire date cannot be selected when the editor is initialized.
Workaround: Me.RadGridView1.Columns("ProductName").TextAlignment = ContentAlignment.MiddleRight
Steps to reproduce: 1. Add a RadGridView with one column and one row to a form 2. Set the value of the only data cell in the grid to a string containing more than 32 'a' characters 3. Type 'a' in the search row. You will see an OverflowException
To reproduce: add a RadGridView with many columns so the horizontal scroll bar will be shown. Start navigating by pressing the right arrow key. You will notice that when you reach the last visible column in the current view, navigating to the next column changes the whole view and the current column is displayed at the beginning of the view. The expected behavior is that after pressing the right arrow key the horizontal scroll bar will move only one column forward.
To reproduce: Add a RadGridView and set the Form.UseWaitCursor property to true. When the cursor is positioned inside the RadGridView the cursor is set back to default. Workaround: public RadForm1() { InitializeComponent(); radGridView1.GridBehavior = new CustomRowBehavior(); } public class CustomRowBehavior : BaseGridBehavior { public override bool OnMouseMove(MouseEventArgs e) { Cursor cursor = this.GridControl.Cursor; bool result = base.OnMouseMove(e); this.GridControl.Cursor = cursor; return result; } }
To reproduce: Declare the following classes: public class Test { public string Name { get; set; } public Child Child { get; set; } } public class Child { public string ChildName { get; set; } public override string ToString() { return ChildName; } } Add the following columns: gridViewTextBoxColumn1.FieldName = "Name"; gridViewTextBoxColumn1.HeaderText = "column1"; gridViewTextBoxColumn1.Name = "column1"; gridViewTextBoxColumn2.FieldName = "Child"; gridViewTextBoxColumn2.HeaderText = "column2"; gridViewTextBoxColumn2.Name = "column2"; this.radGridView1.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { gridViewTextBoxColumn1, gridViewTextBoxColumn2}); this.radGridView1.Name = "radGridView1"; this.radGridView1.Size = new System.Drawing.Size(429, 176); this.radGridView1.TabIndex = 0; this.radGridView1.Text = "radGridView1"; Bind RadGridView to the following data: var data = new List<Test>(); for (int i = 0; i < 10; i++) { data.Add(new Test { Name = "Name" + i, Child = new Child { ChildName = "Child " + i } }); } Export to Excel: ExportToExcelML excelExporter = new ExportToExcelML(radGridView1); excelExporter.RunExport(System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), @"test.xls")); You will notice that column2 will not have text Workaround: Subscribe to the ExcelCellFormatting event: void excelExporter_ExcelCellFormatting(object sender, Telerik.WinControls.UI.Export.ExcelML.ExcelCellFormattingEventArgs e) { if (e.ExcelCellElement.Data.DataItem.GetType().IsClass) { e.ExcelCellElement.Data.DataItem = e.ExcelCellElement.Data.DataItem.ToString(); } }
This happened multiple times. In the property builder, I tried to delete the column and Visual Studio crashed. I was able to delete other columns fine, but this particular column caused a problem. The only difference that I can see between the other columns and the one that caused the problem was the conditionalformattingobject. Once I deleted this conditionalformattingobject, I was able to delete the column without any problem.
To reproduce: add a RadGridView and bind it to Employees data table. 1. Group by "Title". 2. Group by "Country". 3. Group by "City". If you try to expand the "Sales Representative" group, no rows will be displayed. Please refer to the attached gif file, illustrating better the obtained behavior.