To reproduce: 1. Filter the first column in the grid 2. Click the header checkbox 3. Try to clear the filter. you iwll notice that the data is still filtered. Workaround: private void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e) { if (e.CellType==typeof(GridCheckBoxHeaderCellElement)) { e.CellElement = new CustomHeaderCell(e.Column, e.Row); } } public class CustomHeaderCell : GridCheckBoxHeaderCellElement { public CustomHeaderCell(GridViewColumn column, GridRowElement row) : base(column, row) { } protected override void checkbox_ToggleStateChanged(object sender, StateChangedEventArgs args) { base.checkbox_ToggleStateChanged(sender, args); this.TableElement.EndUpdate(false); } }
When the RadGridView is scrolled horizontally, the right border of row header cell disappears.
We'd like to see the ability to enable a search/filter function for column chooser. One of our applications that uses the RadGridView has dozens of columns, most hidden by default. Our users would like the ability to type in part of a column name and have the column chooser filter on it.
Currently RadGridView supports only copy & paste between grid cells
How to reproduce: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; this.radGridView1.EnableFiltering = true; this.radGridView1.ShowHeaderCellButtons = true; this.radGridView1.FilterPopupRequired += RadGridView1_FilterPopupRequired; GridViewDateTimeColumn date = this.radGridView1.Columns["Date"] as GridViewDateTimeColumn; date.DataType = typeof(DateTime); date.FilteringMode = GridViewTimeFilteringMode.Date; } 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; } } private object GetData() { DataTable 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)); DateTime date = DateTime.Now; for (int i = 0; i < 1500; i++) { dt.Rows.Add(i, "Name " + i, date.AddDays(i), i % 2 == 0); } return dt; } Workaround: custom RadListFilterPopup public class MyRadListFilterPopup : RadListFilterPopup { public MyRadListFilterPopup(GridViewDataColumn dataColumn, bool groupedDateValues) : base(dataColumn, groupedDateValues) { } protected override void OnButtonOkClick(EventArgs e) { FilterOperator filterOperator = FilterOperator.IsEqualTo; IRadListFilterElement listFilterElement = typeof(RadListFilterPopup).GetField("listFilterElement", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic). GetValue(this) as IRadListFilterElement; switch (listFilterElement.SelectedMode) { case ListFilterSelectedMode.All: filterOperator = FilterOperator.None; break; case ListFilterSelectedMode.Null: filterOperator = FilterOperator.IsNull; break; case ListFilterSelectedMode.NotNull: filterOperator = FilterOperator.IsNotNull; break; } if (filterOperator != FilterOperator.IsEqualTo) { SetFilterOperator(filterOperator); this.ClosePopup(RadPopupCloseReason.CloseCalled); } else { CompositeFilterDescriptor compositeFilterDescriptor = new CompositeFilterDescriptor(); compositeFilterDescriptor.PropertyName = base.DataColumn.Name; compositeFilterDescriptor.LogicalOperator = FilterLogicalOperator.Or; foreach (DictionaryEntry entry in listFilterElement.SelectedValues) { foreach (object value in (ArrayList)entry.Value) { FilterDescriptor descriptor; if (base.DataColumn is GridViewDateTimeColumn || base.DataColumn.DataType == typeof(DateTime) || base.DataColumn.DataType == typeof(DateTime?)) { descriptor = new DateFilterDescriptor(base.DataColumn.Name, FilterOperator.IsEqualTo, (DateTime?)value, false); } else { descriptor = new FilterDescriptor(base.DataColumn.Name, FilterOperator.IsEqualTo, value); } compositeFilterDescriptor.FilterDescriptors.Add(descriptor); } } base.FilterDescriptor = compositeFilterDescriptor; OnFilterConfirmed(); } } }
Currently it is not possible to insert custom worksheets (for example notes or a cover page) when exporting via ExportToExcelML
How to reproduce: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); GridViewComboBoxColumn supplierColumn = new GridViewComboBoxColumn(); supplierColumn.Name = "SupplierColumn"; supplierColumn.HeaderText = "Supplier"; supplierColumn.DataSource = this.GetListItemData(); ; supplierColumn.ValueMember = "Id"; supplierColumn.DisplayMember = "Description"; supplierColumn.Width = 200; this.radGridView1.Columns.Add(supplierColumn); this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; this.radGridView1.CellEditorInitialized += RadGridView1_CellEditorInitialized; } private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor; if (editor == null) { return; } RadDropDownListEditorElement element = (RadDropDownListEditorElement)editor.EditorElement; element.ValueChanging -= Element_ValueChanging; element.ValueChanging += Element_ValueChanging; } private void Element_ValueChanging(object sender, ValueChangingEventArgs e) { Console.WriteLine("ValueChanging"); Console.WriteLine("Old " + e.OldValue); Console.WriteLine("New " + e.NewValue); } private object GetData() { DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Date", typeof(DateTime)); for (int i = 0; i < 100; i++) { dt.Rows.Add(i, "Name " + i, DateTime.Now.AddDays(i)); } return dt; } public List<Item> GetListItemData() { List<Item> items = new List<Item>(); for (int i = 0; i < 10; i++) { items.Add(new Item(i, "Data" + i, DateTime.Now.AddDays(i).AddHours(i))); } return items; } } public class Item { public int Id { get; set; } public string Description { get; set; } public DateTime Date { get; set; } public Item(int id, string description, DateTime date) { this.Id = id; this.Description = description; this.Date = date; } } Workaround: handle the TextChanging event and store locally the old value private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor; if (editor == null) { return; } RadDropDownListEditorElement element = (RadDropDownListEditorElement)editor.EditorElement; element.TextChanging-= Element_TextChanging; element.TextChanging += Element_TextChanging; element.ValueChanging -= Element_ValueChanging; element.ValueChanging += Element_ValueChanging; } object oldValue; private void Element_TextChanging(object sender, TextChangingEventArgs e) { oldValue = e.OldValue; } private void Element_ValueChanging(object sender, ValueChangingEventArgs e) { Console.WriteLine("ValueChanging"); Console.WriteLine("Old " + oldValue); Console.WriteLine("New " + e.NewValue); }
Improve the filtering by date time column by adding properties that enable choosing whether to include time part and seconds part
There is an exception when resetting the binding source on CellEndEdit after pressing Enter Comment: It is not correct to preserve the CurrentRow position when changing/reseting the binding source. Instead you can preserve its index and restore it when the data source is updated!
Steps to reproduce: 1. Set DPI scale to 150 of all screens 2. Run attached sample 3. The column`s width is not calculated correctly.
create a filter on the "Status" column before clicking Save and Load? Invalid filter expression. ---> Telerik.Data.Expressions.InvalidExpressionException: Cannot perform '=' operation on WindowsFormsApplication1.EmployeeStatus and System.String.
How to reproduce: Create a grid with enabled filtering and open the excel-like filter popup of a DateTime column. Workaround: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); this.radGridView1.EnableFiltering = true; this.radGridView1.ShowFilteringRow = true; this.radGridView1.ShowHeaderCellButtons = true; this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.radGridView1.FilterPopupInitialized += RadGridView1_FilterPopupInitialized; } private void RadGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e) { RadDateFilterPopup popup = e.FilterPopup as RadDateFilterPopup; if (popup != null && popup.Width < 300) { popup.Width += 100; popup.Height += 100; } } private object GetData() { DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Bool", typeof(bool)); dt.Columns.Add("Date", typeof(DateTime)); for (int i = 0; i < 100; i++) { dt.Rows.Add(i, "Name " + i, i % 2 == 0, DateTime.Now.AddDays(1)); } return dt; } }
Clearing and refreshing the rows in a data table bound to a RadComboBoxColumn causes problems in the RadGridView. The column's drop-down stops working and in some cases the entire grid has become unresponsive.
The CustomSorting event should manipulate the pinned rows as well. Thus, the user will be allowed to control the sort order of the pinned rows within the pinned container.
Selecting datasource throws exception, then crashes VS
Workaround: AddHandler Me.RadGridView1.CreateCompositeFilterDialog, AddressOf CreateCompositeFilterDialog Private Sub CreateCompositeFilterDialog(sender As Object, e As GridViewCreateCompositeFilterDialogEventArgs) Dim dialog As New CompositeDataFilterForm() AddHandler dialog.DataFilter.EditorRequired, AddressOf EditorRequired e.Dialog = dialog End Sub Private Sub EditorRequired(sender As Object, e As TreeNodeEditorRequiredEventArgs) Dim filterNode As DataFilterCriteriaNode = TryCast(e.Node, DataFilterCriteriaNode) If filterNode IsNot Nothing AndAlso filterNode.PropertyName = "BASE_NULL_DATE" AndAlso TypeOf sender Is DataFilterValueEditorElement Then e.Editor = New TreeViewDateTimeEditor() End If End Sub
1) When the grid first loads, the top-left most cell is automatically selected. Before clicking anywhere within the grid view, if you hold SHIFT and click the cell to the right of the selected, the following exception is thrown. 2) You can get around the above exception by clicking a different cell in the grid view before performing a SHIFT select or CTRL+C operation is performed against the grid view. If you select a different cell, and then perform a SHIFT selection to a cell in a different column, you will experience the "An entry with the same key already exists." exception
To reproduce: setup self-reference hierarchy. Add a GridViewHyperlinkColumn and show the expander item in this column. Please refer to the attached screenshot. The hyperlink text overlaps with the expander. Workaround: set the MasterTemplate.SelfReferenceExpanderColumn to a different column.
I still have the performance problem. I have attached the same project extende by a new button/(function to create a new group with one root entry and 100 sub-entries. This takes a while due to the log of the data context, but what really takes me off is the performance of the grid when opening this root entry. On my machine (i5, 4GB ram) it takes about 5-6 seconds for the sub-structure to open. The zip also contains an old version of the program and in the bin/debug folder you can find the "RadTest.exe" (as opposed to the RadTest2.exe), wich will open the sub-structure in no time. So - there must be something wrong with my way of working the grid. To reproduce: Run the program, click the "Generate" Button and enter a name for the new group. This will create 101 new entries (1 root, 100 subs), taking about 15-20 secs (which is ok, as I said above). Then open the "RootEntry" within the group -> takes 5-6 seconds. When the subentries are visible, scrolling the grid vertically is really slow as well.