To reproduce: run the attached sample project and click the new row. Workaround: don't call the Begin/EndUpdate methods in the CurrentRowChanged event.
Use attached to reproduce. - Check the filter box - Uncheck the header checkbox. - The cells are still visible and you cannot click on the data check boxes.
In self-reference if you bind the grid to a record having is ParentId the same as its Id, the grid will try to create a row which is parented by itself. This is not valid input data and we should throw a proper exception, otherwise the application will freeze. How to reproduce: public partial class Form2 : Form { private BindingList<DataObject> data; public Form2() { InitializeComponent(); this.radGridView1.AutoGenerateHierarchy = true; this.data = new BindingList<DataObject>(); int count = 10; for (int i = 0; i < count; i++) { DataObject p = new DataObject(); p.Id = i; p.Name = "Parent " + i; this.data.Add(p); for (int j = 0; j < count; j++) { DataObject c = new DataObject(); c.Id = count + j + i * count; c.Name = "Child " + i; c.ParentId = i; this.data.Add(c); } } this.radButton1.Click += RadButton1_Click; } private void RadButton1_Click(object sender, EventArgs e) { if (this.radGridView1.Relations.Count > 0) { this.radGridView1.Relations.Clear(); } this.radGridView1.DataSource = this.data; this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "Id", "ParentId"); } } public class DataObject { public int Id { get; set; } public string Name { get; set; } public int ParentId { get; set; } } Workaround: set the ParentId of the parent records int count = 10; for (int i = 0; i < count; i++) { DataObject p = new DataObject(); p.Id = i; p.Name = "Parent " + i; p.ParentId = -1; this.data.Add(p); for (int j = 0; j < count; j++) { DataObject c = new DataObject(); c.Id = count + j + i * count; c.Name = "Child " + i; c.ParentId = i; this.data.Add(c); } }
Workaround: handle the SortChanging and FilterChanging events and clear the search criteria from the search row. The stored search string can later be restored in the SortChanged and FilterChanged events string filter = string.Empty; private void RadGrid_FilterChanged(object sender, GridViewCollectionChangedEventArgs e) { this.radGrid.MasterView.TableSearchRow.Search(filter); } private void RadGrid_SortChanged(object sender, GridViewCollectionChangedEventArgs e) { this.radGrid.MasterView.TableSearchRow.Search(filter); } private void RadGrid_SortChanging(object sender, GridViewCollectionChangingEventArgs e) { this.filter = this.radGrid.MasterView.TableSearchRow.SearchCriteria; this.radGrid.MasterView.TableSearchRow.Search(null); } private void RadGrid_FilterChanging(object sender, GridViewCollectionChangingEventArgs e) { this.filter = this.radGrid.MasterView.TableSearchRow.SearchCriteria; this.radGrid.MasterView.TableSearchRow.Search(null); }
Hi
I just found a strange issue using the latest bits of the Telerik RadGridView.
I have a grid that contains ColumnGroupsViewDefinition. Inside one of the group, one of the column is a GridViewComboBoxColumn.
The grid shows correctly on the screen.
If I try to export it using GridViewSpreadExport, I get an exception saying "input string was not in a correct format".
The export works fine if:
-I don't have groups
-I export to HTML using ExportToHTML
-I export to HTML using ExportToCSV
Any help please?
When the columns are auto-generated, the way to modify the columns is to use the Columns collection. We could expose an event that will be called when the columns are auto-generating. From the event arguments, we could get the newly created column and replace with if needed or modify it. Similar to the CreateRow event of the control.
Currently, it is only possible to define two filter conditions in the Custom Filter Dialog. It would be better if there is possibility for adding multiple filter conditions, similar to the possibility given by the Conditional Formatting Dialog
If the dropdownlist editor is opened and closed quickly, it produces an exception. The timer of the RadListElement should be reset when the editor is closed and then reopened.
If you have a scenario which involves localization and you have columns with empty strings, these empty string values are serialized in the localization files.
RadGridView should be able to filter by enum values.
The code below causes wrong layout of RadGridView control when 0, A0, A1, B2, C1 rows are expanded: private List<GridViewTemplate> childTemplates; public TestForm2() { InitializeComponent(); } protected override void OnLoad(EventArgs e) {
When the RadGridView is scrolled horizontally, the right border of row header cell disappears.
RadGridView scrolls to the top when copy and paste operations are performed. The grid scrolls to left when there are a lot of columns as well. In addition this is only observed when the cell is not in edit mode. Workaround: public class MyGridBehavior : BaseGridBehavior { public override bool ProcessKey(KeyEventArgs keys) { bool isPaste = false; if (keys.Control && keys.KeyCode == Keys.V && this.GridViewElement.Template.ClipboardCopyMode != GridViewClipboardCopyMode.Disable) { if (!(this.GridViewElement.Template.GridReadOnly || this.GridViewElement.Template.ReadOnly)) { isPaste = true; } } GridTableElement currentTableElement = this.GridViewElement.CurrentView as GridTableElement; int vScroll = currentTableElement.VScrollBar.Value; int hScroll = currentTableElement.HScrollBar.Value; bool result = base.ProcessKey(keys); if (isPaste) { currentTableElement.VScrollBar.Value = vScroll; currentTableElement.HScrollBar.Value = hScroll; } return result; } } this.radGridView1.GridBehavior = new MyGridBehavior();
Custom filtering does not work when self-referencing hierarchy used in RadGridView. Work around: GridView.EnableFiltering = !GridView.EnableFiltering; GridView.EnableFiltering = !GridView.EnableFiltering;
The cell navigation is wrong when the grid is ungrouped. Steps to reproduce: 1. Enable cell selection mode 2. Navigate with keyboard 3. Group the RadGridView by one column 4. Navigate with keyboard 5. Ungroup the RadGridView's rows 6. Now Keyboard navigation is wrong. Same behavior appears with the default selection mode: - Group the grid and select a row in a group - Ungroup and use the keyboard to navigate between the rows => it navigates only the rows that were in the group where we have selected a row WORKAROUND: private void radGridView1_GroupByChanged(object sender, Telerik.WinControls.UI.GridViewCollectionChangedEventArgs e) { GridViewRowInfo row = this.radGridView1.CurrentRow; this.radGridView1.CurrentRow = null; this.radGridView1.CurrentRow = row; }
Filtering is applied, if you clear the filter descriptors and enable/disable custom filtering. Steps to reproduce: 1. Click on the filter button on the Name header. Check only one name, and only one record should be visible in the grid. 2. Click the Clear button. All records should now be visible. 3. Click the Toggle Filter button once, to enable custom filtering. 4. Click the Toggle Filter button again to disable custom filtering. Workaround: private static readonly FieldInfo FilterContextFieldInfo = typeof(RadCollectionView<GridViewRowInfo>).GetField("filterContext", BindingFlags.NonPublic | BindingFlags.Instance); this.radGridView1.FilterDescriptors.Clear(); StringCollection filterContext = FilterContextFieldInfo.GetValue(this.radGridView1.MasterTemplate.DataView) as StringCollection; filterContext.Clear();
Vertical scrolling of self-referencing hierarchy in RadGridView is slow when there is more than 10 columns.